|
|
@@ -12,7 +12,7 @@
|
|
|
/>
|
|
|
|
|
|
<div class="conversation-chat-content">
|
|
|
- <DialogWelcome v-if="show_welcome" class="conversation-chat-area" />
|
|
|
+ <DialogWelcome v-if="show_welcome" class="conversation-chat-area" :agent_info="CHAT_AGENT_INFOMATION" />
|
|
|
<DialogList
|
|
|
v-if="!show_welcome"
|
|
|
ref="list_scroller"
|
|
|
@@ -285,7 +285,7 @@ const handleInputSubmit = async (options) => {
|
|
|
* 整理客户端提问的数据
|
|
|
* 组装Question数据
|
|
|
*/
|
|
|
- const client_question = formatDialogQuestionByClient(ask_text, ask_files);
|
|
|
+ const client_question = formatDialogQuestionByClient(ask_text, ask_files, CHAT_AGENT_INFOMATION.value);
|
|
|
// 保存用户的提问信息
|
|
|
// 当消息正式发出后,将提问数据放入列表中
|
|
|
chat_new_question.value = client_question;
|
|
|
@@ -333,7 +333,7 @@ function handleWSSend(chat_id, value) {
|
|
|
// 消息即将发送,记录用户的提问数据
|
|
|
chat_new_list.value.push(chat_new_question.value);
|
|
|
// 客户端依据此数据展示加载中的动画
|
|
|
- const loadingMsg = formatDialogAnswerForLoading();
|
|
|
+ const loadingMsg = formatDialogAnswerForLoading(CHAT_AGENT_INFOMATION.value);
|
|
|
chat_new_list.value.push(loadingMsg);
|
|
|
|
|
|
/**
|
|
|
@@ -393,7 +393,7 @@ function handleWSMessage(e) {
|
|
|
/**
|
|
|
* 整理返回的数据
|
|
|
*/
|
|
|
- const currentChat = formatDialogAnswerFromWebsocketReceiveMessage(res_data, last_msg);
|
|
|
+ const currentChat = formatDialogAnswerFromWebsocketReceiveMessage(res_data, last_msg, CHAT_AGENT_INFOMATION.value);
|
|
|
const chat_status = currentChat.status;
|
|
|
const chat_message = currentChat.message;
|
|
|
|
|
|
@@ -460,6 +460,27 @@ onMounted(() => {
|
|
|
const agent_id = props.agent_id;
|
|
|
const session_id = props.session_id;
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据agent_id 查询到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
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 组件挂载
|
|
|
if (session_id) {
|
|
|
// 有历史记录:获取历史记录内容进行展示
|
|
|
@@ -470,7 +491,7 @@ onMounted(() => {
|
|
|
const session_list = res.data;
|
|
|
|
|
|
// 将列表数据进行转化
|
|
|
- const list = formatDialogHistory(session_list);
|
|
|
+ const list = formatDialogHistory(session_list, CHAT_AGENT_INFOMATION.value);
|
|
|
|
|
|
// 如果历史记录不为空
|
|
|
// 则需要展示对话内容
|
|
|
@@ -493,27 +514,6 @@ onMounted(() => {
|
|
|
} else {
|
|
|
// 无历史记录:等待创建会话内容(用户开始输入、提交完成),列表区域显示欢迎界面
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据agent_id 查询到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
|
|
|
- };
|
|
|
- }
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
// ---------------------------------------------------------
|