From 38f220863910bfa8daee03fb837809ca95456589 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:13:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=80=90=E5=BA=94=E7=94=A8=E3=80=91?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AF=B9=E8=AF=9D=E6=97=B6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=98=BE=E7=A4=BA=E7=9F=A5=E8=AF=86=E6=9D=A5?= =?UTF-8?q?=E6=BA=90(#45)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/ai-chat/index.vue | 25 +++++++++++-------- .../component/LimitDialog.vue | 7 ++++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 7390a84fa..92e167c40 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -53,6 +53,7 @@ +
-
+
知识来源
@@ -271,7 +274,7 @@ function openParagraph(row: any, id?: string) { } function quickProblemHandle(val: string) { - if (!props.log && !loading.value) { + if (!props.log && !loading.value && props.data?.name && props.data?.model_id) { // inputValue.value = val // nextTick(() => { // quickInputRef.value?.focus() @@ -488,7 +491,7 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean) { } }) .then(() => { - return !props.appId && getSourceDetail(chat) + return (id || props.data?.show_source) && getSourceDetail(chat) }) .finally(() => { ChatManagement.close(chat.id) @@ -505,14 +508,16 @@ function regenerationChart(item: chatType) { } function getSourceDetail(row: any) { - logApi.getRecordDetail(id, chartOpenId.value, row.record_id, loading).then((res) => { - const exclude_keys = ['answer_text', 'id'] - Object.keys(res.data).forEach((key) => { - if (!exclude_keys.includes(key)) { - row[key] = res.data[key] - } + logApi + .getRecordDetail(id || props.appId, chartOpenId.value, row.record_id, loading) + .then((res) => { + const exclude_keys = ['answer_text', 'id'] + Object.keys(res.data).forEach((key) => { + if (!exclude_keys.includes(key)) { + row[key] = res.data[key] + } + }) }) - }) return true } diff --git a/ui/src/views/application-overview/component/LimitDialog.vue b/ui/src/views/application-overview/component/LimitDialog.vue index cb127ad3d..0f0af4d73 100644 --- a/ui/src/views/application-overview/component/LimitDialog.vue +++ b/ui/src/views/application-overview/component/LimitDialog.vue @@ -1,6 +1,9 @@