对话流实现 文件上传

This commit is contained in:
2025-11-06 16:43:28 +08:00
parent d9d62e22de
commit 0bb4853d54
35 changed files with 1748 additions and 575 deletions

View File

@@ -19,6 +19,8 @@ export interface AiAgentConfig extends BaseDTO {
description?: string;
/** 系统提示词 */
systemPrompt?: string;
/** 是否连接互联网0否 1是 */
connectInternet?: number;
/** 模型名称 */
modelName?: string;
/** 模型提供商 */
@@ -73,6 +75,8 @@ export interface AiKnowledge extends BaseDTO {
export interface AiUploadFile extends BaseDTO {
/** 知识库ID */
knowledgeId?: string;
/** 系统文件ID关联tb_sys_file */
sysFileId?: string;
/** 文件名 */
fileName?: string;
/** 文件路径 */
@@ -139,6 +143,8 @@ export interface AiMessage extends BaseDTO {
content?: string;
/** 关联文件IDJSON数组 */
fileIDs?: string;
/** 关联文件列表(前端附加,用于显示文件详情) */
files?: AiUploadFile[];
/** 引用知识IDJSON数组 */
knowledgeIDs?: string;
/** 知识库引用详情JSON数组 */
@@ -185,10 +191,15 @@ export interface ChatRequest {
conversationId?: string;
/** 用户问题 */
query: string;
/** 指定的知识库ID列表可选 */
knowledgeIds?: string[];
/** 是否流式返回 */
stream?: boolean;
fileIDs?: string;
/** 上传的文件列表Dify文件信息 */
files?: Array<{
type: string;
transfer_method: string;
upload_file_id: string;
}>;
}
/**