fix: icon of tool provider in agent

This commit is contained in:
JzoNg 2024-11-28 15:57:56 +08:00
parent 3ddb3d2bff
commit 5f76975e12

View File

@ -50,7 +50,11 @@ const AgentTools: FC = () => {
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.split('/').pop() && collection.type === item.provider_type)
const collection = collectionList.find(
collection =>
collection.id.split('/').pop() === item.provider_id.split('/').pop()
&& collection.type === item.provider_type,
)
const icon = collection?.icon
return {
...item,