feat: Enable search capability for Qwen commercial version model
This commit is contained in:
parent
7139d5093a
commit
b38a9c954a
@ -1668,6 +1668,11 @@ export function isWebSearchModel(model: Model): boolean {
|
|||||||
if (provider.id === 'zhipu') {
|
if (provider.id === 'zhipu') {
|
||||||
return model?.id?.startsWith('glm-4-')
|
return model?.id?.startsWith('glm-4-')
|
||||||
}
|
}
|
||||||
|
if (provider.id === 'dashscope') {
|
||||||
|
const models = ['qwen-turbo', 'qwen-max', 'qwen-plus']
|
||||||
|
// matches id like qwen-max-0919, qwen-max-latest
|
||||||
|
return models.some((i) => model.id.startsWith(i))
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -1680,7 +1685,14 @@ export function getOpenAIWebSearchParams(assistant: Assistant, model: Model): Re
|
|||||||
if (model.provider === 'hunyuan') {
|
if (model.provider === 'hunyuan') {
|
||||||
return { enable_enhancement: true }
|
return { enable_enhancement: true }
|
||||||
}
|
}
|
||||||
|
if (model.provider === 'dashscope') {
|
||||||
|
return {
|
||||||
|
enable_search: true,
|
||||||
|
search_options: {
|
||||||
|
forced_search: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
tools: webSearchTools
|
tools: webSearchTools
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user