feat: 接入一库一工具知识检索
- 编译知识库英文运行名、描述、检索配置和独立 Registration - 统一最终分数阈值并保持模型上下文、检索事件与引用一致 - 完善 AG-UI 知识库检索运行态与完成态展示
This commit is contained in:
@@ -3,6 +3,7 @@ import type {
|
||||
ChatTimelineKnowledgeHit,
|
||||
ChatTimelineMessageItem,
|
||||
ChatTimelineSkillInvocationStatus,
|
||||
ChatTimelineStatusStatus,
|
||||
ChatTimelineToolStatus,
|
||||
} from '@easyflow/common-ui';
|
||||
|
||||
@@ -131,6 +132,13 @@ function asyncToolStatus(
|
||||
return 'running';
|
||||
}
|
||||
|
||||
function knowledgeRetrievalStatus(value: unknown): ChatTimelineStatusStatus {
|
||||
const status = asText(value).trim().toLowerCase();
|
||||
if (status === 'running') return 'running';
|
||||
if (status === 'error' || status === 'failed') return 'error';
|
||||
return 'done';
|
||||
}
|
||||
|
||||
function statusKey(
|
||||
payload: Record<string, unknown>,
|
||||
options: AguiTimelineProjectionOptions,
|
||||
@@ -275,7 +283,7 @@ function applyCustomEvent(
|
||||
if (event.name === easyFlowAguiCustomEvent.knowledgeRetrievalStatus) {
|
||||
ChatTimelineBuilder.upsertKnowledgeRetrievalStatus(
|
||||
items,
|
||||
asText(payload.status).toLowerCase() === 'running' ? 'running' : 'done',
|
||||
knowledgeRetrievalStatus(payload.status),
|
||||
statusKey(payload, options, 'knowledge-retrieval'),
|
||||
turnMetadata,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user