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 @@