Rerank接口
约 278 字小于 1 分钟
2025-04-25
rerank接口
接口地址:https://c4ai.ccccltd.cn/api/compatible/v1/rerank
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*
接口描述:
请求示例:
{
"model": "jiaorong-bge-reranker-v2-m3",
"query": "Apple",
"documents": [
"苹果",
"香蕉",
"水果",
"蔬菜"
],
"top_n": 4,
"return_documents": false,
"max_chunks_per_doc": 1024,
"overlap_tokens": 80
}请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| rerankRequest | RerankRequest | body | true | RerankRequest | RerankRequest |
| model | 对应的模型名称。可选项: rerank | true | string | ||
| query | 检索查询文本 | true | string | ||
| documents | 待重排序的文档列表 | true | array | string | |
| top_n | 返回最相关的文档数量 | false | integer(int32) | ||
| return_documents | 是否返回文档内容,默认 false | false | boolean | ||
| max_chunks_per_doc | 单个文档最大分块数,默认 1024 | false | integer(int32) | ||
| overlap_tokens | 分块时相邻块的 token 重叠数,默认 80 | false | integer(int32) |
响应状态:
| 状态码 | 说明 | schema |
|---|---|---|
| 200 | OK |
响应参数:
暂无
响应示例:
{
"id": "0196565e67cd72fdade547ecfe064fd8",
"results": [
{
"document": null,
"index": 0,
"relevance_score": 0.9953725
},
{
"document": null,
"index": 2,
"relevance_score": 0.002157342
},
{
"document": null,
"index": 1,
"relevance_score": 4.6371284E-4
},
{
"document": null,
"index": 3,
"relevance_score": 1.7502925E-5
}
],
"tokens": null
}