feat: export marked results with VLM data and tags

- toggleMark now captures vlm_description, vlm_description_localized, vlm_tags, vlm_objects, thumbnail_url
- exportMarked generates structured JSON with vlm section containing en/localized descriptions and tags
- Export filename changed to vlm-marked-export-{timestamp}.json
- Includes source_type, scene_index, trace_id for complete result metadata
This commit is contained in:
2026-10-23 18:15:38 +08:00
parent fa8e4a9191
commit 6db184c7d0

View File

@@ -1610,22 +1610,52 @@ function toggleMark(r: any) {
start_time: r.start_time, start_time: r.start_time,
end_time: r.end_time, end_time: r.end_time,
summary: r.summary, summary: r.summary,
similarity: r.similarity text_content: r.text_content,
similarity: r.similarity,
thumbnail_url: r.thumbnail_url,
vlm_description: r.vlm_description || r.vlm_description_en || '',
vlm_description_localized: r.vlm_description_localized || '',
vlm_tags: r.vlm_tags || [],
vlm_objects: r.vlm_objects || [],
source_type: r.source_type,
trace_id: r.trace_id,
scene_index: r.scene_index
}) })
} }
} }
function exportMarked() { function exportMarked() {
const base = getApiBase()
const data = { const data = {
exportedAt: new Date().toISOString(), exportedAt: new Date().toISOString(),
count: markedResults.value.length, count: markedResults.value.length,
results: markedResults.value results: markedResults.value.map((r: any) => ({
file_uuid: r.file_uuid,
file_name: r.file_name,
source_type: r.source_type,
scene_index: r.scene_index,
trace_id: r.trace_id,
time_range: {
start_frame: r.start_frame,
end_frame: r.end_frame,
start_time: r.start_time,
end_time: r.end_time
},
vlm: {
description_en: r.vlm_description || '',
description_localized: r.vlm_description_localized || '',
tags: r.vlm_tags || [],
objects: r.vlm_objects || []
},
thumbnail_url: r.thumbnail_url ? `${base}${r.thumbnail_url}` : null,
similarity: r.similarity
}))
} }
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' }) const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' })
const url = URL.createObjectURL(blob) const url = URL.createObjectURL(blob)
const a = document.createElement('a') const a = document.createElement('a')
a.href = url a.href = url
a.download = `search-export-${Date.now()}.json` a.download = `vlm-marked-export-${Date.now()}.json`
a.click() a.click()
URL.revokeObjectURL(url) URL.revokeObjectURL(url)
} }