查询问答策略
更新时间:2025-06-27
GET
https://qianfan.baidubce.com/v2/ai_search/qa_strategy
分页查询问答策略
权限说明
调用本API,需使用API Key鉴权方式。Authorization的值为Bearer <API Key>。获取API Key流程,请查看授权。
请求参数
Headers 参数
除公共头域外,无其它特殊头域
URL 参数
offset
string
偏移量
可选
limit
string
条数限制,最大不超过50
可选
config_id
string
策略配置id,需要提前调用配置接口创建id
可选
请求结构
GET /v2/ai_search/qa_strategy HTTP/1.1
HOST: qianfan.baidubce.com
Authorization: Bearer <API Key>
Content-Type: application/json
?offset=2&limit=4
示例代码
curl
curl --location 'https://qianfan.baidubce.com/v2/ai_search/qa_strategy?offset=2&limit=4' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API Key>' \
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
request_id
string
请求request_id
必选
code
string
错误代码,当发生异常时返回
可选
message
string
错误消息,当发生异常时返回
可选
count
integer
结果总数
必选
items
array
问答策略数组
必选
显示子属性
隐藏子属性
items
object {3}
显示子属性
隐藏子属性
answer_strategy
object {0}
回复策略
可选
显示子属性
隐藏子属性
暂无参数
query_match_strategy
object {0}
query匹配策略
可选
显示子属性
隐藏子属性
暂无参数
query
string
query
可选
JSON
{
"request_id": "123",
"count": 14,
"items": [{
"qa_strategy": {
"answer_strategy": {
"knowledge_base_answer_strategy_detail": null,
"name": "preset_answer",
"preset_answer_strategy_detail": {
"content": "今天xx价格多钱",
"references": [{
"content": "快讯 美元指数再次冲高!金价小幅上涨!...",
"date": "2024-12-03",
"given_to_llm": true,
"icon": "https://appbuilder.bj.bcebos.com/baidu-searag-pro/icon/default.png",
"image_detail": {
"height": null,
"url": null,
"width": null
},
"ref_num": "1",
"resource_type": "web",
"title": "今天xx价格多少多少钱...",
"url": "http://www.hgjinjiage.cn/",
"video": null,
"web_anchor": "xx查询网"
}]
}
},
"query_match_strategy": {
"name": "exact",
"similarity_threshold": 0.0
},
"query": "xx是组装厂吗"
}
}]
}