{
"results": [
{
"index": 2,
"relevance_score": 0.999071
},
{
"index": 0,
"relevance_score": 0.32713068
},
{
"index": 1,
"relevance_score": 0.1867867
}
],
"id": "07734bd2-2473-4f07-94e1-0d9f0e6843cf",
"meta": {
"api_version": {
"version": "2",
"is_experimental": false
},
"billed_units": {
"search_units": 1
}
}
}
{
"results": [
{
"index": 1,
"relevance_score": 0.918472
},
{
"index": 0,
"relevance_score": 0.854321
},
{
"index": 2,
"relevance_score": 0.423156
}
],
"id": "8f734bd2-2473-4f07-94e1-0d9f0e68ebfa",
"meta": {
"api_version": {
"version": "2"
},
"billed_units": {
"search_units": 1
}
}
}
POST /v1/rerank
Authorization: Bearer $NEWAPI_API_KEY
$NEWAPI_API_KEY
是您的 API 密钥。X-Client-Name
model
query
documents
top_n
max_tokens_per_doc
results
index
: 整数,对应于原始文档列表中文档的索引relevance_score
: 浮点数,相关性分数范围为[0, 1]。接近1的分数表示与查询高度相关,接近0的分数表示相关性较低id
meta
api_version
: 对象,包含API版本信息version
: 字符串,API版本号is_deprecated
: 布尔值,是否已弃用is_experimental
: 布尔值,是否为实验性功能billed_units
: 对象,包含计费信息search_units
: 浮点数,计费的搜索单位数tokens
: 对象,包含令牌使用统计input_tokens
: 浮点数,作为模型输入的令牌数output_tokens
: 浮点数,模型产生的令牌数warnings
400 Bad Request
: 请求格式或参数错误401 Unauthorized
: 未提供有效的API密钥403 Forbidden
: 没有权限访问此资源404 Not Found
: 请求的资源不存在422 Unprocessable Entity
: 请求格式正确但包含语义错误429 Too Many Requests
: 请求频率超过限制500 Internal Server Error
: 服务器内部错误503 Service Unavailable
: 服务暂时不可用