feat(web): 文档查询意图补充风险过滤与 X 天前范围
- aiDocumentQueryIntent 新增风险等级过滤(无/高/中/低/有风险)与 N 天前日期范围解析 - aiDocumentQueryModel/aiConversationHtmlRenderer 渲染适配风险过滤标签 - useWorkbenchAiDocumentQueryFlow/aiWorkbenchConversationStore 会话流转适配命令意图 - 更新 ai-document-query-model/ai-conversation-html-renderer/assistant-session-draft-delete 测试
This commit is contained in:
@@ -2,6 +2,7 @@ import { nextTick } from 'vue'
|
||||
|
||||
import {
|
||||
buildAiDocumentQueryConditionSummary,
|
||||
buildAiDocumentQueryThinkingEvents,
|
||||
buildAiDocumentQueryMessage,
|
||||
filterAiDocumentQueryRecords,
|
||||
mergeAiDocumentQueryPayloads,
|
||||
@@ -100,33 +101,20 @@ export function useWorkbenchAiDocumentQueryFlow({
|
||||
await nextTick()
|
||||
}
|
||||
|
||||
async function handleAiDocumentQueryIntent(prompt, pendingMessage) {
|
||||
async function handleAiDocumentQueryIntent(prompt, pendingMessage, options = {}) {
|
||||
const intent = resolveAiDocumentQueryIntent(prompt)
|
||||
if (!intent) {
|
||||
return false
|
||||
}
|
||||
|
||||
const conditionSummary = buildAiDocumentQueryConditionSummary(intent)
|
||||
let thinkingEvents = [
|
||||
{
|
||||
eventId: 'document-query-parse',
|
||||
title: '解析自然语言筛选条件',
|
||||
content: `正在从您的问题里提取查询来源、单据类型、时间、状态、费用类型、关键词和金额条件。当前识别:${conditionSummary}。`,
|
||||
status: 'running'
|
||||
},
|
||||
{
|
||||
eventId: 'document-query-fetch',
|
||||
title: '查询业务单据接口',
|
||||
content: resolveAiDocumentQueryFetchPendingText(intent),
|
||||
status: 'pending'
|
||||
},
|
||||
{
|
||||
eventId: 'document-query-filter',
|
||||
title: '组合筛选单据',
|
||||
content: '等待接口返回后,再按已识别条件做二次筛选。',
|
||||
status: 'pending'
|
||||
}
|
||||
]
|
||||
let thinkingEvents = buildAiDocumentQueryThinkingEvents(intent, {
|
||||
commandFrame: options.commandFrame
|
||||
}).map((event) => (
|
||||
event.eventId === 'document-query-fetch'
|
||||
? { ...event, content: resolveAiDocumentQueryFetchPendingText(intent) }
|
||||
: event
|
||||
))
|
||||
await updateAiDocumentQueryThinking(pendingMessage, thinkingEvents)
|
||||
await waitForAiDocumentQueryStep()
|
||||
|
||||
@@ -163,7 +151,9 @@ export function useWorkbenchAiDocumentQueryFlow({
|
||||
await updateAiDocumentQueryThinking(pendingMessage, thinkingEvents)
|
||||
await waitForAiDocumentQueryStep()
|
||||
|
||||
const finalMessageText = buildAiDocumentQueryMessage(intent, payload)
|
||||
const finalMessageText = buildAiDocumentQueryMessage(intent, payload, {
|
||||
commandFrame: options.commandFrame
|
||||
})
|
||||
thinkingEvents = completeAiDocumentQueryEvent(
|
||||
thinkingEvents,
|
||||
'document-query-filter',
|
||||
|
||||
Reference in New Issue
Block a user