fix: 修复【应用编排】客户端提问达到限制时,隐藏知识来源 (#696)
This commit is contained in:
parent
bcb27737dc
commit
1c3ea93f06
@ -29,6 +29,7 @@ interface chatType {
|
|||||||
is_stop?: boolean
|
is_stop?: boolean
|
||||||
record_id: string
|
record_id: string
|
||||||
vote_status: string
|
vote_status: string
|
||||||
|
status?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ChatRecordManage {
|
export class ChatRecordManage {
|
||||||
@ -105,6 +106,12 @@ export class ChatManagement {
|
|||||||
chatRecord.append(content)
|
chatRecord.append(content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static updateStatus(chatRecordId: string, code: number) {
|
||||||
|
const chatRecord = this.chatMessageContainer[chatRecordId]
|
||||||
|
if (chatRecord) {
|
||||||
|
chatRecord.chat.status = code
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 持续从缓存区 写出数据
|
* 持续从缓存区 写出数据
|
||||||
* @param chatRecordId 对话记录id
|
* @param chatRecordId 对话记录id
|
||||||
|
|||||||
@ -104,7 +104,7 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.write_ed && props.appId" class="flex-between">
|
<div v-if="item.write_ed && props.appId && 500 != item.status" class="flex-between">
|
||||||
<OperationButton
|
<OperationButton
|
||||||
:data="item"
|
:data="item"
|
||||||
:applicationId="appId"
|
:applicationId="appId"
|
||||||
@ -280,7 +280,7 @@ watch(
|
|||||||
function showSource(row: any) {
|
function showSource(row: any) {
|
||||||
if (props.log) {
|
if (props.log) {
|
||||||
return true
|
return true
|
||||||
} else if (row.write_ed) {
|
} else if (row.write_ed && 500 !== row.status) {
|
||||||
if (id || props.data?.show_source) {
|
if (id || props.data?.show_source) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -453,6 +453,7 @@ const errorWrite = (chat: any, message?: string) => {
|
|||||||
ChatManagement.addChatRecord(chat, 50, loading)
|
ChatManagement.addChatRecord(chat, 50, loading)
|
||||||
ChatManagement.write(chat.id)
|
ChatManagement.write(chat.id)
|
||||||
ChatManagement.append(chat.id, message || '抱歉,当前正在维护,无法提供服务,请稍后再试!')
|
ChatManagement.append(chat.id, message || '抱歉,当前正在维护,无法提供服务,请稍后再试!')
|
||||||
|
ChatManagement.updateStatus(chat.id, 500)
|
||||||
ChatManagement.close(chat.id)
|
ChatManagement.close(chat.id)
|
||||||
}
|
}
|
||||||
function chatMessage(chat?: any, problem?: string, re_chat?: boolean) {
|
function chatMessage(chat?: any, problem?: string, re_chat?: boolean) {
|
||||||
@ -466,7 +467,8 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean) {
|
|||||||
write_ed: false,
|
write_ed: false,
|
||||||
is_stop: false,
|
is_stop: false,
|
||||||
record_id: '',
|
record_id: '',
|
||||||
vote_status: '-1'
|
vote_status: '-1',
|
||||||
|
status: undefined
|
||||||
})
|
})
|
||||||
chatList.value.push(chat)
|
chatList.value.push(chat)
|
||||||
ChatManagement.addChatRecord(chat, 50, loading)
|
ChatManagement.addChatRecord(chat, 50, loading)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user