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/Editor/plugin/InitialValuePlugin.tsx b/web/src/views/Workflow/components/Editor/plugin/InitialValuePlugin.tsx index 9a3eaa94..ebccff50 100644 --- a/web/src/views/Workflow/components/Editor/plugin/InitialValuePlugin.tsx +++ b/web/src/views/Workflow/components/Editor/plugin/InitialValuePlugin.tsx @@ -52,7 +52,7 @@ const InitialValuePlugin: React.FC = ({ value, options const root = $getRoot(); root.clear(); - const parts = value.split(/(\{\{[^}]+\}\}|\n)/); + const parts = (value ?? '').split(/(\{\{[^}]+\}\}|\n)/); let paragraph = $createParagraphNode(); parts.forEach(part => { 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; diff --git a/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx b/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx index 7857eb23..ba1e9a5f 100644 --- a/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx +++ b/web/src/views/Workflow/components/Properties/ToolConfig/index.tsx @@ -1,6 +1,6 @@ import { type FC, useEffect, useState, useMemo } from "react"; import { useTranslation } from 'react-i18next' -import { Form, Select, InputNumber, Switch, Cascader, type CascaderProps, Tooltip } from 'antd' +import { Form, Select, Switch, Cascader, type CascaderProps, Tooltip } from 'antd' import type { Suggestion } from '../../Editor/plugin/AutocompletePlugin' import { getToolMethods, getToolDetail, getTools } from '@/api/tools' import type { ToolType, ToolItem } from '@/views/ToolManagement/types' @@ -171,14 +171,15 @@ const ToolConfig: FC<{ options: Suggestion[]; }> = ({ const filterChild = vo.children.filter(child => child.dataType === 'number') if (filterChild.length > 0) { - list.push({ ...vo, children: filterChild }) - } else { + list.push({ ...vo, disabled: vo.dataType !== 'number', children: filterChild }) + } else if (vo.dataType === 'number') { list.push({ ...vo, children: [] }) } - } else { + } else if (vo.dataType === 'number') { list.push({ ...vo }) } }) + console.log('options', options, list) return list }, [options])