ai对话优化知识库选择
This commit is contained in:
@@ -88,6 +88,7 @@ export interface ChatPrepareData {
|
||||
userId?: string
|
||||
/** 用户类型(false=来客,true=员工) */
|
||||
userType?: boolean
|
||||
service?: string
|
||||
}
|
||||
|
||||
// ==================== 请求参数类型(必传校验) ====================
|
||||
@@ -106,24 +107,6 @@ export interface CreateChatParam {
|
||||
title?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 准备流式对话参数
|
||||
*/
|
||||
export interface PrepareChatParam {
|
||||
/** 对话ID(必传) */
|
||||
chatId: string
|
||||
/** 用户问题(必传) */
|
||||
query: string
|
||||
/** 智能体ID(必传) */
|
||||
agentId: string
|
||||
/** 用户类型(必传) */
|
||||
userType: boolean
|
||||
/** 用户ID */
|
||||
userId?: string
|
||||
/** 文件列表 */
|
||||
files?: DifyFileInfo[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止对话参数
|
||||
*/
|
||||
|
||||
@@ -131,7 +131,6 @@ declare module 'shared/types' {
|
||||
DifyFileInfo,
|
||||
ChatPrepareData,
|
||||
CreateChatParam,
|
||||
PrepareChatParam,
|
||||
StopChatParam,
|
||||
CommentMessageParam,
|
||||
ChatListParam,
|
||||
|
||||
@@ -275,7 +275,7 @@ import type {
|
||||
TbChat,
|
||||
TbChatMessage,
|
||||
TbAgent,
|
||||
PrepareChatParam,
|
||||
ChatPrepareData,
|
||||
SSEMessageData,
|
||||
DifyFileInfo,
|
||||
TbSysFileDTO
|
||||
@@ -479,13 +479,14 @@ const sendMessage = async () => {
|
||||
}
|
||||
|
||||
// 准备流式对话参数
|
||||
const prepareParam: PrepareChatParam = {
|
||||
const prepareParam: ChatPrepareData = {
|
||||
chatId: currentChatId.value!,
|
||||
query: query,
|
||||
agentId: agentId,
|
||||
userType: userType.value,
|
||||
userId: userId.value,
|
||||
files: uploadedFiles.value.length > 0 ? uploadedFiles.value : undefined
|
||||
files: uploadedFiles.value.length > 0 ? uploadedFiles.value : undefined,
|
||||
service: "workcase"
|
||||
}
|
||||
|
||||
// 清空已上传的文件
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
TbChat,
|
||||
TbChatMessage,
|
||||
CreateChatParam,
|
||||
PrepareChatParam,
|
||||
ChatPrepareData,
|
||||
StopChatParam,
|
||||
CommentMessageParam,
|
||||
ChatListParam,
|
||||
@@ -72,7 +72,7 @@ export const aiChatAPI = {
|
||||
* 准备流式对话会话
|
||||
* @param param agentId、chatId、query、userId 必传
|
||||
*/
|
||||
prepareChatMessageSession(param: PrepareChatParam): Promise<ResultDomain<string>> {
|
||||
prepareChatMessageSession(param: ChatPrepareData): Promise<ResultDomain<string>> {
|
||||
return request<string>({ url: `${this.baseUrl}/stream/prepare`, method: 'POST', data: param })
|
||||
},
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {
|
||||
TbChat,
|
||||
TbChatMessage,
|
||||
CreateChatParam,
|
||||
PrepareChatParam,
|
||||
ChatPrepareData,
|
||||
StopChatParam,
|
||||
CommentMessageParam,
|
||||
ChatListParam,
|
||||
|
||||
@@ -354,13 +354,14 @@
|
||||
}
|
||||
|
||||
// 准备流式对话(包含文件)
|
||||
const prepareData = {
|
||||
const prepareData: ChatPrepareData = {
|
||||
chatId: chatId.value,
|
||||
query: query,
|
||||
agentId: agentId,
|
||||
userType: userType.value,
|
||||
userId: userInfo.value.userId,
|
||||
files: files.length > 0 ? files : undefined
|
||||
files: files.length > 0 ? files : undefined,
|
||||
service: "workcase"
|
||||
}
|
||||
console.log('准备流式对话参数:', JSON.stringify(prepareData))
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ export interface ChatPrepareData {
|
||||
userId?: string
|
||||
/** 用户类型(false=来客,true=员工) */
|
||||
userType?: boolean
|
||||
service?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,23 +126,6 @@ export interface CreateChatParam {
|
||||
title?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 准备流式对话参数
|
||||
*/
|
||||
export interface PrepareChatParam {
|
||||
/** 对话ID(必传) */
|
||||
chatId: string
|
||||
/** 用户问题(必传) */
|
||||
query: string
|
||||
/** 智能体ID */
|
||||
agentId: string
|
||||
userType: boolean
|
||||
/** 用户ID */
|
||||
userId?: string
|
||||
/** 用户类型 */
|
||||
/** 文件列表 */
|
||||
files?: DifyFileInfo[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止对话参数
|
||||
|
||||
Reference in New Issue
Block a user