fix: tool id (#13932)

This commit is contained in:
zxhlyh
2025-02-18 18:17:41 +08:00
committed by GitHub
parent 653f6c2d46
commit 3460c1dfbd
10 changed files with 53 additions and 25 deletions

View File

@@ -26,6 +26,7 @@ import { CollectionType } from '@/app/components/tools/types'
import { useGetLanguage } from '@/context/i18n'
import type { AgentNodeType } from '../nodes/agent/types'
import { useStrategyProviders } from '@/service/use-strategy'
import { canFindTool } from '@/utils'
export const useChecklist = (nodes: Node[], edges: Edge[]) => {
const { t } = useTranslation()
@@ -51,7 +52,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
moreDataForCheckValid = getToolCheckParams(node.data as ToolNodeType, buildInTools, customTools, workflowTools, language)
if (provider_type === CollectionType.builtIn)
toolIcon = buildInTools.find(tool => tool.id === node.data.provider_id)?.icon
toolIcon = buildInTools.find(tool => canFindTool(tool.id, node.data.provider_id || ''))?.icon
if (provider_type === CollectionType.custom)
toolIcon = customTools.find(tool => tool.id === node.data.provider_id)?.icon