import { ComputedRef, Ref } from 'vue'; import { Attachment } from '@opentiny/tiny-robot'; import { UnifiedModelConfig } from '../types/model-config'; export interface MultimodalConfig { /** 最大文件大小(MB) - 支持响应式 */ maxFileSize?: number | ComputedRef; /** 支持的文件类型(MIME类型前缀,如 'image/') - 支持响应式 */ supportedTypes?: string[] | ComputedRef; } /** * 多模态配置(完整版本,支持模型感知) */ export interface MultimodalOptionsWithModel { /** 当前选中的模型 */ selectedModel: Ref; /** 当前选中的模型 ID */ selectedModelId: Ref; } /** * 将附件转换为多模态消息内容(AI SDK 格式) * @param attachments 附件列表 * @returns Promise 多模态消息内容数组 */ export declare function convertAttachmentsToContent(attachments: Attachment[]): Promise; /** * 多模态消息 Composable(基础版本) * 适用于不需要模型感知的场景 */ export declare function useMultimodal(config?: MultimodalConfig): { attachments: Ref<({ url: string; size: number; rawFile?: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; } | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; } | { rawFile: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; }; url?: string | undefined; size?: number | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; })[], Attachment[] | ({ url: string; size: number; rawFile?: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; } | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; } | { rawFile: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; }; url?: string | undefined; size?: number | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; })[]>; handleFilesSelected: (files: File[]) => Promise; clearAttachments: () => void; }; /** * 多模态消息 Composable(完整版本) * 集成模型感知、自动验证、切换处理等高级功能 * * @param options 包含选中的模型和模型ID * @returns 多模态功能的完整API */ export declare function useMultimodalWithModel(options: MultimodalOptionsWithModel): { hasMultimodalSupport: ComputedRef; attachments: Ref<({ url: string; size: number; rawFile?: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; } | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; } | { rawFile: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; }; url?: string | undefined; size?: number | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; })[], Attachment[] | ({ url: string; size: number; rawFile?: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; } | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; } | { rawFile: { readonly lastModified: number; readonly name: string; readonly webkitRelativePath: string; readonly size: number; readonly type: string; arrayBuffer: () => Promise; bytes: () => Promise>; slice: (start?: number, end?: number, contentType?: string) => Blob; stream: () => ReadableStream>; text: () => Promise; }; url?: string | undefined; size?: number | undefined; id?: string | undefined; name?: string | undefined; status?: import('@opentiny/tiny-robot').FileStatus | undefined; fileType?: import('@opentiny/tiny-robot').FileType | undefined; message?: string | undefined; })[]>; onFilesSelected: (files: File[]) => void; checkCanSendAttachments: () => boolean; processAttachments: () => Promise; cleanupAttachments: () => void; clearAttachments: () => void; };