|
@@ -58,8 +58,8 @@ import DialogInput from '../../modules/conversation-chat/DialogInput.vue';
|
|
|
import DialogFooter from '../../modules/conversation-chat/DialogFooter.vue';
|
|
import DialogFooter from '../../modules/conversation-chat/DialogFooter.vue';
|
|
|
import DialogAsideRight from '../../modules/conversation-chat/DialogAsideRight.vue';
|
|
import DialogAsideRight from '../../modules/conversation-chat/DialogAsideRight.vue';
|
|
|
|
|
|
|
|
-import { useAllAgentStore } from '../../base/store/use-all-agents';
|
|
|
|
|
-import getAgentClientConfig from '../../modules/conversation-board/get-agent-client-config';
|
|
|
|
|
|
|
+// import { useAllAgentStore } from '../../base/store/use-all-agents';
|
|
|
|
|
+import getChatAgentInfomation from '../../modules/conversation-board/get-chat-agent-infomation';
|
|
|
|
|
|
|
|
import useWebSocketChat from '../../modules/conversation-dialog/use-websocket-chat';
|
|
import useWebSocketChat from '../../modules/conversation-dialog/use-websocket-chat';
|
|
|
import { getHistoryLogs, getDialogChatId, uploadFiles } from '../../modules/conversation-dialog/api-dialog';
|
|
import { getHistoryLogs, getDialogChatId, uploadFiles } from '../../modules/conversation-dialog/api-dialog';
|
|
@@ -99,7 +99,7 @@ const props = defineProps({
|
|
|
chat_type: String
|
|
chat_type: String
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const allAgents = useAllAgentStore();
|
|
|
|
|
|
|
+// const allAgents = useAllAgentStore();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 对话使用到的agent信息
|
|
* 对话使用到的agent信息
|
|
@@ -374,10 +374,16 @@ const handleInputSubmit = async (options) => {
|
|
|
// 文件上传成功
|
|
// 文件上传成功
|
|
|
const file_uploaded = uploadResult.data;
|
|
const file_uploaded = uploadResult.data;
|
|
|
|
|
|
|
|
- if (Array.isArray(file_uploaded)) {
|
|
|
|
|
- files_response = file_uploaded;
|
|
|
|
|
|
|
+ // TODO: 统一文件上传数据
|
|
|
|
|
+ // 文档智能的文件上传文件信息在 files 里
|
|
|
|
|
+ if (file_uploaded.files) {
|
|
|
|
|
+ files_response = file_uploaded.files;
|
|
|
} else {
|
|
} else {
|
|
|
- files_response = [file_uploaded];
|
|
|
|
|
|
|
+ if (Array.isArray(file_uploaded)) {
|
|
|
|
|
+ files_response = file_uploaded;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ files_response = [file_uploaded];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// 文件上传异常
|
|
// 文件上传异常
|
|
@@ -402,7 +408,7 @@ const handleInputSubmit = async (options) => {
|
|
|
* 获取文件参数
|
|
* 获取文件参数
|
|
|
* 组装socket参数
|
|
* 组装socket参数
|
|
|
*/
|
|
*/
|
|
|
- const msg = formatDialogSendOptions(ask_text, files_response);
|
|
|
|
|
|
|
+ const msg = formatDialogSendOptions(ask_text, files_response, CHAT_AGENT_INFOMATION.value);
|
|
|
|
|
|
|
|
// 发送websocket消息
|
|
// 发送websocket消息
|
|
|
handleWSSend(chat_new_id.value, msg);
|
|
handleWSSend(chat_new_id.value, msg);
|
|
@@ -552,21 +558,7 @@ onMounted(() => {
|
|
|
* 从而确定agent的相关功能支持,例如:是否需要上传文件,支持上传什么类型的文件、支持上传多少个文件?
|
|
* 从而确定agent的相关功能支持,例如:是否需要上传文件,支持上传什么类型的文件、支持上传多少个文件?
|
|
|
* 例如:主题、背景、等等
|
|
* 例如:主题、背景、等等
|
|
|
*/
|
|
*/
|
|
|
- const agentInfo = allAgents.getInfo(agent_id);
|
|
|
|
|
- if (agentInfo) {
|
|
|
|
|
- const client_config = getAgentClientConfig(agent_id);
|
|
|
|
|
- if (client_config) {
|
|
|
|
|
- CHAT_AGENT_INFOMATION.value = {
|
|
|
|
|
- config: client_config,
|
|
|
|
|
- agent: agentInfo
|
|
|
|
|
- };
|
|
|
|
|
- } else {
|
|
|
|
|
- CHAT_AGENT_INFOMATION.value = {
|
|
|
|
|
- config: {},
|
|
|
|
|
- agent: agentInfo
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ CHAT_AGENT_INFOMATION.value = getChatAgentInfomation(agent_id);
|
|
|
|
|
|
|
|
// 组件挂载
|
|
// 组件挂载
|
|
|
if (session_id) {
|
|
if (session_id) {
|