手动控制参数说明当请求中包含web_search_options字段时,联网搜索会被激活。
使用示例:
("web_search_options": {})若已经配置意图识别,web_search_options参数还具备控制搜索改写数量的能力,通过search_context_size字段控制。
search_context_size支持三个级别:
low:生成1个搜索查询(适合简单问题)。
medium:生成3个搜索查询(默认值)。
high:生成5个搜索查询(适合复杂问题)。
使用示例:
{
"web_search_options": {
"search_context_size": "medium"
}
}在curl中完整的请求样例:
curl --location 'http://your-domain/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-max",
"stream": true,
"web_search_options": {
"search_context_size": "medium"
},
"messages": [
{
"role": "user",
"content": "介绍下通义千问"
}
]
}'