feat: multimodal support (image) (#27793)

Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Wu Tianwei
2025-12-09 11:44:50 +08:00
committed by GitHub
parent a44b800c85
commit 14d1b3f9b3
77 changed files with 2932 additions and 579 deletions

View File

@@ -85,7 +85,8 @@ export type DataSet = {
pipeline_id?: string
is_published?: boolean // Indicates if the pipeline is published
runtime_mode: 'rag_pipeline' | 'general'
enable_api: boolean
enable_api: boolean // Indicates if the service API is enabled
is_multimodal: boolean // Indicates if the dataset supports multimodal
}
export type ExternalAPIItem = {
@@ -541,6 +542,15 @@ export type SegmentsQuery = {
enabled?: boolean | 'all'
}
export type Attachment = {
id: string
name: string
size: number
extension: string
mime_type: string
source_url: string
}
export type SegmentDetailModel = {
id: string
position: number
@@ -566,6 +576,7 @@ export type SegmentDetailModel = {
answer?: string
child_chunks?: ChildChunkDetail[]
updated_at: number
attachments: Attachment[]
}
export type SegmentsResponse = {
@@ -577,14 +588,20 @@ export type SegmentsResponse = {
page: number
}
export type Query = {
content: string
content_type: 'text_query' | 'image_query',
file_info: Attachment | null
}
export type HitTestingRecord = {
id: string
content: string
source: 'app' | 'hit_testing' | 'plugin'
source_app_id: string
created_by_role: 'account' | 'end_user'
created_by: string
created_at: number
queries: Query[]
}
export type HitTestingChildChunk = {
@@ -598,7 +615,8 @@ export type HitTesting = {
content: Segment
score: number
tsne_position: TsnePosition
child_chunks?: HitTestingChildChunk[] | null
child_chunks: HitTestingChildChunk[] | null
files: Attachment[]
}
export type ExternalKnowledgeBaseHitTesting = {
@@ -680,6 +698,7 @@ export type SegmentUpdater = {
answer?: string
keywords?: string[]
regenerate_child_chunks?: boolean
attachment_ids?: string[]
}
export type ErrorDocsResponse = {
@@ -814,3 +833,24 @@ export type IndexingStatusBatchRequest = {
datasetId: string
batchId: string
}
export type HitTestingRecordsRequest = {
datasetId: string
page: number
limit: number
}
export type HitTestingRequest = {
query: string
attachment_ids: string[]
retrieval_model: RetrievalConfig
}
export type ExternalKnowledgeBaseHitTestingRequest = {
query: string
external_retrieval_model: {
top_k: number
score_threshold: number
score_threshold_enabled: boolean
}
}