From 4663af8a60f5909e83cd01ba988191da8a96779c Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 2 Jan 2025 08:43:09 +0800 Subject: [PATCH] tool setting schema --- .../plugins/plugin-detail-panel/tool-selector/index.tsx | 4 ++-- web/app/components/workflow/block-selector/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx index a5b96e4eea..c59a1799f3 100644 --- a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx +++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx @@ -107,7 +107,7 @@ const ToolSelector: FC = ({ const [isShowChooseTool, setIsShowChooseTool] = useState(false) const handleSelectTool = (tool: ToolDefaultValue) => { - const paramValues = addDefaultValue(tool.params, toolParametersToFormSchemas(tool.paramSchemas as any)) + const paramValues = addDefaultValue(tool.params, toolParametersToFormSchemas(tool.paramSchemas.filter(param => param.form !== 'llm') as any)) const toolValue = { provider_name: tool.provider_id, tool_name: tool.tool_name, @@ -133,7 +133,7 @@ const ToolSelector: FC = ({ const currentToolParams = useMemo(() => { if (!currentProvider) return [] - return currentProvider.tools.find(tool => tool.name === value?.tool_name)?.parameters || [] + return currentProvider.tools.find(tool => tool.name === value?.tool_name)?.parameters.filter(param => param.form !== 'llm') || [] }, [currentProvider, value]) const formSchemas = useMemo(() => toolParametersToFormSchemas(currentToolParams), [currentToolParams]) diff --git a/web/app/components/workflow/block-selector/types.ts b/web/app/components/workflow/block-selector/types.ts index c02a74e3a4..787c3fbff1 100644 --- a/web/app/components/workflow/block-selector/types.ts +++ b/web/app/components/workflow/block-selector/types.ts @@ -27,6 +27,6 @@ export type ToolDefaultValue = { title: string is_team_authorization: boolean params: Record - paramSchemas: Record + paramSchemas: Record[] output_schema: Record }