Appearance
Rerank(重排序)
接口:POST /v1/rerank
请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | ✅ | Rerank 模型名称 |
query | string | ✅ | 查询文本 |
documents | array | ✅ | 待排序的文档列表 |
top_n | int | ❌ | 返回前 N 个结果 |
return_documents | bool | ❌ | 是否在结果中返回原文 |
响应
json
{
"results": [
{
"index": 0,
"relevance_score": 0.95,
"document": {"text": "原始文档文本"}
}
],
"usage": {
"prompt_tokens": 100,
"total_tokens": 100
}
}