知识来源
@@ -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 @@
+
+
+
({
+ show_source: false,
access_num: 0,
white_active: true,
white_list: ''
@@ -62,6 +66,7 @@ const loading = ref(false)
watch(dialogVisible, (bool) => {
if (!bool) {
form.value = {
+ show_source: false,
access_num: 0,
white_active: true,
white_list: ''
@@ -70,6 +75,7 @@ watch(dialogVisible, (bool) => {
})
const open = (data: any) => {
+ form.value.show_source = data.show_source
form.value.access_num = data.access_num
form.value.white_active = data.white_active
form.value.white_list = data.white_list?.length ? data.white_list?.join('\n') : ''
@@ -81,6 +87,7 @@ const submit = async (formEl: FormInstance | undefined) => {
await formEl.validate((valid, fields) => {
if (valid) {
const obj = {
+ show_source: form.value.show_source,
white_list: form.value.white_list ? form.value.white_list.split('\n') : [],
white_active: form.value.white_active,
access_num: form.value.access_num