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:
@@ -1610,22 +1610,52 @@ function toggleMark(r: any) {
|
||||
start_time: r.start_time,
|
||||
end_time: r.end_time,
|
||||
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() {
|
||||
const base = getApiBase()
|
||||
const data = {
|
||||
exportedAt: new Date().toISOString(),
|
||||
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 url = URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = `search-export-${Date.now()}.json`
|
||||
a.download = `vlm-marked-export-${Date.now()}.json`
|
||||
a.click()
|
||||
URL.revokeObjectURL(url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user