From 19fb466074b0da29459ffaa2dda24ca801c41f7f Mon Sep 17 00:00:00 2001 From: JzoNg Date: Wed, 20 Nov 2024 16:20:53 +0800 Subject: [PATCH] fix: tool icon in app configure --- .../app/configuration/config/agent/agent-tools/index.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx index 35cee8eefc..40c4232270 100644 --- a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx +++ b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx @@ -44,13 +44,13 @@ const AgentTools: FC = () => { const [currentTool, setCurrentTool] = useState(null) const currentCollection = useMemo(() => { if (!currentTool) return null - const collection = collectionList.find(collection => collection.id === currentTool?.provider_id && collection.type === currentTool?.provider_type) + const collection = collectionList.find(collection => collection.id === currentTool?.provider_id.split('/').pop() && collection.type === currentTool?.provider_type) return collection }, [currentTool, collectionList]) const [isShowSettingTool, setIsShowSettingTool] = useState(false) const [isShowSettingAuth, setShowSettingAuth] = useState(false) const tools = (modelConfig?.agentConfig?.tools as AgentTool[] || []).map((item) => { - const collection = collectionList.find(collection => collection.id === item.provider_id && collection.type === item.provider_type) + const collection = collectionList.find(collection => collection.id === item.provider_id.split('/').pop() && collection.type === item.provider_type) const icon = collection?.icon return { ...item, @@ -157,11 +157,10 @@ const AgentTools: FC = () => {
- {item.provider_type === CollectionType.builtIn ? item.provider_name : item.tool_label} + {item.provider_type === CollectionType.builtIn ? item.provider_name.split('/').pop() : item.tool_label} {item.tool_name} {!item.isDeleted && (