Anspire 多轮改写 API文档
一、API简介
多轮改写(QueryRewrite)主要用于多轮对话中,进行指代消解和省略补全。使用本接口,可根据对话历史即可生成更精确的用户查询。在应用场景上,本接口可应用于智能问答、对话式搜索等多种场景。
接口域名:https://plugin.anspire.cn
二、API接口
1.多轮改写
请求接口
🔗 /api/rewrite/query
请求方法
POST
请求参数
序号 | 参数 | 类型 | 必填 | 说明 |
---|---|---|---|---|
1 | Question | string | 是 | 查询问题 |
2 | Messages | string | 是 | 查询历史 |
请求头
序号 | 参数 | 类型 | 取值 | 说明 |
---|---|---|---|---|
1 | Authorization | string | {{}} | key |
2 | Content-Type | string | application/json | json格式 |
响应头
序号 | 参数 | 值 |
---|---|---|
1 | date | Mon, 21 Apr 2025 06:57:43 GMT |
2 | server | uvicorn |
3 | content-length | 163 |
4 | content-type | application/json |
5 | x-request-id | 1fa4d5ba-3fcd-4fe3-92b5-65b1fcd211de |
示例
输入参数
{
"Question": "国内哪里?",
"Messages": [
{
"Role": "user",
"Content": "你家在哪里"
},
{
"Role": "assistant",
"Content": "我家在国内"
}
]
}
输出参数
{
"Response": {
"Content": "你家在国内哪里?",
"RequestId": "05a85704-6304-4337-ac9b-ee1fd868e732",
"Usage": {
"InputTokens": 67,
"OutputTokens": 6,
"TotalTokens": 73
}
}
}