1 请求参数
model指定要调用的 Rerank 模型 ID,例如
s125c8e0e。query用于排序的查询语句。
documents需要进行重排序的文档字符串数组。
2 请求示例
json
{
"model": "s125c8e0e",
"query": "夏天最好吃的水果是?",
"documents": ["西瓜", "草莓", "荔枝"]
}3 响应
- 成功响应示例
json
{
"id": "xxx",
"object": "xxxx",
"created": 1737030836,
"model": "xop3qwen0b6reranker",
"results": [
{
"index": 0,
"relevance_score": 0.2704802
},
{
"index": 2,
"relevance_score": 0.0011695
},
{
"index": 1,
"relevance_score": 0.0002780
}
],
"usage": {
"prompt_tokens": 131,
"total_tokens": 131
}
}注意
results数组中的document字段已在较新版本中移除,仅返回索引和分数。
- 响应参数说明
id本次调用的唯一 ID。
object对象类型。
created响应生成的 Unix 时间戳。
model实际调用的模型名称。
results包含排序结果的数组。注意:此数组默认不按分数排序。
index对应原始
documents 数组中的索引。relevance_score文档与查询的相关性得分。
usageToken 使用统计信息。