import type { MessageContentType } from './constants'; export interface BinaryInputContent { data?: string; filename?: string; id?: string; mimeType: string; type: MessageContentType.Binary; url?: string; } export type ContentMap = AIBluekingContentMap & { [MessageContentType.Binary]: BinaryInputContent; [MessageContentType.FlowAgent]: BkFlowMessageContent; [MessageContentType.Function]: string; [MessageContentType.KeyValue]: { key: string; value: string; }[]; [MessageContentType.KnowledgeRag]: KnowledgeRagMessageContent; [MessageContentType.Other]: any; [MessageContentType.ReferenceDocument]: ReferenceDocumentContent[]; [MessageContentType.Text]: string; }; export type ContentType = keyof ContentMap; export type InputContent = BinaryInputContent | TextInputContent; export type ReferenceDocumentContent = { name: string; originFile: string; url: string; }; export type TextInputContent = { text: string; type: MessageContentType.Text; }; declare global { interface AIBluekingContentMap { } } export type BkFlowMessageContent = BkFlowTask[]; export type BkFlowNode = { elapsed_time: number; finish_time: string; id: string; loop: number; name: string; retry: number; retryable?: boolean; skip: boolean; skippable?: boolean; start_time: string; state: string; type: string; }; export type BkFlowTask = { confidence_title?: string; has_confidence?: boolean; is_active?: boolean; nodes: Record; statistics: { state_counts: Record; total: number; }; task_id: number; task_name: string; task_outputs: unknown; task_state: string; }; export type KnowledgeRagMessageContent = { content: string; referenceDocument: ReferenceDocumentContent[]; };