mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 19:06:51 +08:00
fix: tool id (#13932)
This commit is contained in:
@@ -56,12 +56,34 @@ export async function fetchWithRetry<T = any>(fn: Promise<T>, retries = 3): Prom
|
||||
}
|
||||
}
|
||||
|
||||
export const correctProvider = (provider: string) => {
|
||||
export const correctModelProvider = (provider: string) => {
|
||||
if (!provider)
|
||||
return ''
|
||||
|
||||
if (provider.includes('/'))
|
||||
return provider
|
||||
|
||||
if (['google'].includes(provider))
|
||||
return 'langgenius/gemini/google'
|
||||
|
||||
return `langgenius/${provider}/${provider}`
|
||||
}
|
||||
|
||||
export const correctToolProvider = (provider: string) => {
|
||||
if (!provider)
|
||||
return ''
|
||||
|
||||
if (provider.includes('/'))
|
||||
return provider
|
||||
|
||||
if (['stepfun', 'jina', 'siliconflow'].includes(provider))
|
||||
return `langgenius/${provider}_tool/${provider}`
|
||||
|
||||
return `langgenius/${provider}/${provider}`
|
||||
}
|
||||
|
||||
export const canFindTool = (providerId: string, oldToolId?: string) => {
|
||||
return providerId === oldToolId
|
||||
|| providerId === `langgenius/${oldToolId}/${oldToolId}`
|
||||
|| providerId === `langgenius/${oldToolId}_tool/${oldToolId}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user