From bfecc73de92c5643fa6d56cbf69f02d1f9f7013d Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 26 Dec 2024 17:58:34 +0800 Subject: [PATCH 1/3] support extra for tool selector --- .../plugin-detail-panel/tool-selector/index.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 18ff2a3707..a1d7573c8b 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 @@ -41,8 +41,8 @@ type Props = { value?: { provider: string tool_name: string - description?: string parameters?: Record + extra?: Record } disabled?: boolean placement?: Placement @@ -50,8 +50,8 @@ type Props = { onSelect: (tool: { provider: string tool_name: string - description?: string parameters?: Record + extra?: Record }) => void supportAddCustomTool?: boolean scope?: string @@ -101,7 +101,10 @@ const ToolSelector: FC = ({ const handleDescriptionChange = (e: React.ChangeEvent) => { onSelect({ ...value, - description: e.target.value || '', + extra: { + ...value?.extra, + description: e.target.value || '', + }, } as any) } @@ -186,7 +189,7 @@ const ToolSelector: FC = ({