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

@@ -14,6 +14,7 @@ import type { ToolParameter } from '@/app/components/tools/types'
import { CollectionType } from '@/app/components/tools/types'
import type { BlockEnum } from '@/app/components/workflow/types'
import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks'
import { canFindTool } from '@/utils'
const i18nPrefix = 'workflow.nodes.parameterExtractor'
@@ -56,7 +57,7 @@ const ImportFromTool: FC<Props> = ({
return []
}
})()
const currCollection = currentTools.find(item => item.id === provider_id)
const currCollection = currentTools.find(item => canFindTool(item.id, provider_id))
const currTool = currCollection?.tools.find(tool => tool.name === tool_name)
const toExactParams = (currTool?.parameters || []).filter((item: any) => item.form === 'llm')
const formattedParams = toParmExactParams(toExactParams, language)