From 78137be892b6810b54ba70f27c28a69a7179e603 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期一, 15 七月 2024 15:59:35 +0800
Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/WI/Web.V1.0

---
 src/components/chat/Chat.vue |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue
index 733a746..b253488 100644
--- a/src/components/chat/Chat.vue
+++ b/src/components/chat/Chat.vue
@@ -8,7 +8,7 @@
 					<div class="flex">
 						<div class="relative" v-if="item.content?.values">
 							<div class="text-sm rounded-[6px] p-4 leading-relaxed max-w-[100ch] bg-white">
-								<component class="max-w-[100ch]" :is="answerTypeMapCom[item.content.type]" :data="item.content.values" />
+								<component class="max-w-[100ch]" :is="answerTypeMapCom[item.content.type]" :data="item.content.values" :error="item.content.error"/>
 							</div>
 
 							<div v-if="item.role === RoleEnum.assistant" class="absolute flex items-center right-0 mr-2 mt-2 space-x-2">
@@ -57,7 +57,7 @@
 import { GetHistoryAnswer, QueryHistoryDetail, QuestionAi, SetHistoryAnswerState, getQuestionProcess } from '/@/api/ai/chat';
 import PlayBar from '/@/components/chat/components/playBar/PlayBar.vue';
 import router from '/@/router';
-import { activeChatRoom, activeLLMId, activeRoomId, activeSampleId, activeSectionAId } from '/@/stores/chatRoom';
+import { activeChatRoom, activeLLMId, activeRoomId, activeSampleId, activeSectionAId, roomConfig } from '/@/stores/chatRoom';
 import { v4 as uuidv4 } from 'uuid';
 
 let isTalking = ref(false);
@@ -103,6 +103,7 @@
 			content = {
 				type: AnswerType.Summary,
 				values: res.summary,
+				error: res.error,
 			};
 			break;
 		default:
@@ -159,6 +160,7 @@
 		// FIXME: 鏆傛椂杩欐牱
 		section_a_id: currentSectionId,
 		history_group_id: currentRouteId,
+		raw_mode: roomConfig.value?.[currentRouteId]?.isAnswerByLLM ?? false,
 	} as any;
 
 	if (currentSampleId) {
@@ -191,14 +193,16 @@
 let currentSampleId = null;
 
 let currentLLMId = null;
+
 const getAnswerById = async (historyId: string) => {
 	return await GetHistoryAnswer({
 		history_id: historyId,
 	});
 };
+
 const sendChatMessage = async (content: ChatContent = messageContent.value) => {
 	if (!messageContent.value?.values) return;
-	if (messageList.value.length===0) {
+	if (messageList.value.length === 0) {
 		if (activeSampleId.value) {
 			currentSampleId = activeSampleId.value;
 		}
@@ -243,7 +247,6 @@
 		messageList.value.at(-1).content = content;
 	}
 };
-
 
 onMounted(async () => {
 	const res = await QueryHistoryDetail({
@@ -297,10 +300,10 @@
 	}
 );
 
-onActivated(()=>{
+onActivated(() => {
 	if (forbidScroll) return;
 	nextTick(() => scrollToBottom());
-})
+});
 
 //#region ====================== 鑱婂ぉ鍐呭鎿嶄綔 ======================
 

--
Gitblit v1.9.3