文档重排序
根据查询对文档列表进行相关性重排序
POST
https://api.xiexus.cn/v1/rerank
请求体:必填
接口信息
方法
POST路径
/v1/rerank完整地址
https://api.xiexus.cn/v1/rerank请求体
必填
标签
重排序(Rerank)
响应码
200
静态文件
当前接口页内已嵌入 OpenAPI JSON;如果需要查看总文件,可直接打开固定静态文件
relay.json。当前 JSON
../../openapi/generated/ai-model/重排序(Rerank)/post-v1-rerank-creatererank-383826486.json总文件
../../openapi/relay.jsonOpenAPI JSON
已将服务地址固定为
https://api.xiexus.cn,其余结构保持和源文档一致。{
"openapi": "3.1.0",
"info": {
"title": "文档重排序",
"version": "1.0.0",
"description": "根据查询对文档列表进行相关性重排序"
},
"tags": [
{
"name": "重排序(Rerank)"
}
],
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "使用 Bearer Token 认证。\n格式: `Authorization: Bearer sk-xxxxxx`\n"
}
}
},
"paths": {
"/v1/rerank": {
"post": {
"tags": [
"重排序(Rerank)"
],
"summary": "文档重排序",
"description": "根据查询对文档列表进行相关性重排序",
"operationId": "creatererank",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"model",
"query",
"documents"
],
"properties": {
"model": {
"type": "string",
"examples": [
"rerank-english-v2.0"
]
},
"query": {
"type": "string",
"description": "查询文本"
},
"documents": {
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {},
"x-apifox-orders": []
}
]
},
"description": "要重排序的文档列表"
},
"top_n": {
"type": "integer",
"description": "返回前 N 个结果"
},
"return_documents": {
"type": "boolean",
"default": false
}
},
"x-apifox-orders": [
"model",
"query",
"documents",
"top_n",
"return_documents"
]
}
}
}
},
"security": [
{
"BearerAuth": []
}
],
"responses": {
"200": {
"description": "成功重排序",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"index": {
"type": "integer"
},
"relevance_score": {
"type": "number"
},
"document": {
"type": "object",
"properties": {},
"x-apifox-orders": []
}
},
"x-apifox-orders": [
"index",
"relevance_score",
"document"
]
}
},
"meta": {
"type": "object",
"properties": {},
"x-apifox-orders": []
}
},
"x-apifox-orders": [
"id",
"results",
"meta"
]
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api.xiexus.cn",
"description": "固定生产地址"
}
]
}