Domain name for API request: es.intl.tencentcloudapi.com.
Rearrangement refers to the process in RAG where, by assessing the relevance between documents and queries, the most relevant documents are placed at the front. This ensures that the language model prioritizes high-ranking context when generating responses, improving the accuracy and reliability of generated results. It can also be used for filtering to reduce large model costs.
This API has a single-account call limit. If you need to increase the concurrent limit, please contact us (https://www.tencentcloud.com/act/event/Online_service?from_cn_redirect=1).
A maximum of 1000 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: RunRerank. |
| Version | Yes | String | Common Params. The value used for this API: 2025-01-01. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| ModelName | Yes | String | Model name, selectable model list: bge-reranker-large, bge-reranker-v2-m3. |
| Query | Yes | String | Query text. |
| Documents.N | Yes | Array of String | List of candidate docs to sort. |
| TopN | No | Integer | Number of top documents returned in sorting order. If not specified, return all candidate docs. If the specified top_n value is larger than the number of input candidate docs, return all docs. |
| ReturnDocuments | No | Boolean | Whether to return the original document for each sorting result inside the result list. Default value: False. |
| Parameter Name | Type | Description |
|---|---|---|
| Data | Array of RerankResult | Output result set. |
| Usage | Usage | token consumption. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: es.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: RunRerank
<Common request parameters>
{
"ModelName": "bge-rerank-large",
"Query": "Hello",
"Documents": [
Hello?
"Hello."
]
}
{
"Response": {
"Data": [
{
"Document": "",
"Index": 1,
"RelevanceScore": 0.9998511075973511
},
{
"Document": "",
"Index": 0,
"RelevanceScore": 0.9996849298477173
}
],
"RequestId": "cf9c5598-9625-436d-bc81-8dd3900e63c0",
"Usage": {
"TotalTokens": 10
}
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InternalError | Internal error. |
| InvalidParameter | Parameter error. |
| InvalidParameterValue | Parameter value error. |
| LimitExceeded | The quota limit is exceeded. |
| MissingParameter | Parameters are missing. |
| RequestLimitExceeded | Number of requests exceeds the frequency limit. |
| UnauthorizedOperation | Unauthorized operation. |
| UnknownParameter | Unknown parameter error. |
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários