Merge branch 'main' into deploy/dev

This commit is contained in:
jyong 2025-03-10 12:04:45 +08:00
commit aa900ba1fe
2 changed files with 8 additions and 4 deletions

View File

@ -630,13 +630,14 @@ const Configuration: FC = () => {
tools: modelConfig.agent_mode?.tools.filter((tool: any) => {
return !tool.dataset
}).map((tool: any) => {
const toolInCollectionList = collectionList.find(c => tool.provider_id === c.id)
return {
...tool,
isDeleted: res.deleted_tools?.some((deletedTool: any) => deletedTool.id === tool.id && deletedTool.tool_name === tool.tool_name),
notAuthor: collectionList.find(c => tool.provider_id === c.id)?.is_team_authorization === false,
notAuthor: toolInCollectionList?.is_team_authorization === false,
...(tool.provider_type === 'builtin' ? {
provider_id: correctToolProvider(tool.provider_name),
provider_name: correctToolProvider(tool.provider_name),
provider_id: correctToolProvider(tool.provider_name, !!toolInCollectionList),
provider_name: correctToolProvider(tool.provider_name, !!toolInCollectionList),
} : {}),
}
}),

View File

@ -69,10 +69,13 @@ export const correctModelProvider = (provider: string) => {
return `langgenius/${provider}/${provider}`
}
export const correctToolProvider = (provider: string) => {
export const correctToolProvider = (provider: string, toolInCollectionList?: boolean) => {
if (!provider)
return ''
if (toolInCollectionList)
return provider
if (provider.includes('/'))
return provider