From 5d439346a1b7fd6ce7a39ccde4161158494a8f4c Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 7 Apr 2026 17:20:19 +0800 Subject: [PATCH] fix(web): app's knowledge support graph retrieval --- web/src/i18n/en.ts | 1 + web/src/i18n/zh.ts | 1 + .../components/Knowledge/KnowledgeConfigModal.tsx | 2 +- .../views/ApplicationConfig/components/Knowledge/types.ts | 6 +++--- .../Properties/Knowledge/KnowledgeConfigModal.tsx | 2 +- .../views/Workflow/components/Properties/Knowledge/types.ts | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index caaaad89..bf1a3ce8 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1270,6 +1270,7 @@ export const en = { participle: 'Participle retrieval', semantic: 'Semantic retrieval', hybrid: 'Hybrid Retrieval', + graph: 'Graph Retrieval', similarity_threshold: 'Semantic similarity threshold', similarity_threshold_desc: 'Only return results with semantic similarity higher than this threshold', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index 50f35813..a774ec55 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -657,6 +657,7 @@ export const zh = { participle: '分词检索', semantic: '语义检索', hybrid: '混合检索', + graph: '图谱检索', similarity_threshold: '语义相似度阈值', similarity_threshold_desc: '仅返回语义相似度高于此阈值的结果', diff --git a/web/src/views/ApplicationConfig/components/Knowledge/KnowledgeConfigModal.tsx b/web/src/views/ApplicationConfig/components/Knowledge/KnowledgeConfigModal.tsx index 6b1000d4..1969579b 100644 --- a/web/src/views/ApplicationConfig/components/Knowledge/KnowledgeConfigModal.tsx +++ b/web/src/views/ApplicationConfig/components/Knowledge/KnowledgeConfigModal.tsx @@ -32,7 +32,7 @@ interface KnowledgeConfigModalProps { /** * Available retrieval types */ -const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid'] +const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid', 'graph'] /** * Modal for configuring knowledge base retrieval settings diff --git a/web/src/views/ApplicationConfig/components/Knowledge/types.ts b/web/src/views/ApplicationConfig/components/Knowledge/types.ts index 9ede67dd..b2e11928 100644 --- a/web/src/views/ApplicationConfig/components/Knowledge/types.ts +++ b/web/src/views/ApplicationConfig/components/Knowledge/types.ts @@ -1,8 +1,8 @@ /* * @Author: ZhaoYing * @Date: 2026-02-03 16:25:53 - * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-02-03 16:25:53 + * @Last Modified by: ZhaoYing + * @Last Modified time: 2026-04-07 17:16:47 */ /** * Type definitions for knowledge base configuration in application settings @@ -28,7 +28,7 @@ export interface RerankerConfig { * - semantic: Semantic similarity based retrieval * - hybrid: Combination of both methods */ -export type RetrieveType = 'participle' | 'semantic' | 'hybrid' +export type RetrieveType = 'participle' | 'semantic' | 'hybrid' | 'graph' /** * Knowledge base configuration form data diff --git a/web/src/views/Workflow/components/Properties/Knowledge/KnowledgeConfigModal.tsx b/web/src/views/Workflow/components/Properties/Knowledge/KnowledgeConfigModal.tsx index 7ecf3ef8..3766e238 100644 --- a/web/src/views/Workflow/components/Properties/Knowledge/KnowledgeConfigModal.tsx +++ b/web/src/views/Workflow/components/Properties/Knowledge/KnowledgeConfigModal.tsx @@ -12,7 +12,7 @@ const FormItem = Form.Item; interface KnowledgeConfigModalProps { refresh: (values: KnowledgeConfigForm, type: 'knowledgeConfig') => void; } -const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid'] +const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid', 'graph'] const KnowledgeConfigModal = forwardRef(({ refresh, diff --git a/web/src/views/Workflow/components/Properties/Knowledge/types.ts b/web/src/views/Workflow/components/Properties/Knowledge/types.ts index 99834092..a0472b4b 100644 --- a/web/src/views/Workflow/components/Properties/Knowledge/types.ts +++ b/web/src/views/Workflow/components/Properties/Knowledge/types.ts @@ -5,7 +5,7 @@ export interface RerankerConfig { reranker_id?: string | undefined; reranker_top_k?: number | undefined; } -export type RetrieveType = 'participle' | 'semantic' | 'hybrid' +export type RetrieveType = 'participle' | 'semantic' | 'hybrid' | 'graph' export interface KnowledgeConfigForm { kb_id?: string; similarity_threshold?: number;