Selecione suas preferências de cookies

Usamos cookies essenciais e ferramentas semelhantes que são necessárias para fornecer nosso site e serviços. Usamos cookies de desempenho para coletar estatísticas anônimas, para que possamos entender como os clientes usam nosso site e fazer as devidas melhorias. Cookies essenciais não podem ser desativados, mas você pode clicar em “Personalizar” ou “Recusar” para recusar cookies de desempenho.

Se você concordar, a AWS e terceiros aprovados também usarão cookies para fornecer recursos úteis do site, lembrar suas preferências e exibir conteúdo relevante, incluindo publicidade relevante. Para aceitar ou recusar todos os cookies não essenciais, clique em “Aceitar” ou “Recusar”. Para fazer escolhas mais detalhadas, clique em “Personalizar”.

Rerank - Amazon Bedrock
Esta página não foi traduzida para seu idioma. Solicitar tradução

Rerank

Reranks the relevance of sources based on queries. For more information, see Improve the relevance of query responses with a reranker model.

Request Syntax

POST /rerank HTTP/1.1 Content-type: application/json { "nextToken": "string", "queries": [ { "textQuery": { "text": "string" }, "type": "string" } ], "rerankingConfiguration": { "bedrockRerankingConfiguration": { "modelConfiguration": { "additionalModelRequestFields": { "string" : JSON value }, "modelArn": "string" }, "numberOfResults": number }, "type": "string" }, "sources": [ { "inlineDocumentSource": { "jsonDocument": JSON value, "textDocument": { "text": "string" }, "type": "string" }, "type": "string" } ] }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

nextToken

If the total number of results was greater than could fit in a response, a token is returned in the nextToken field. You can enter that token in this field to return the next batch of results.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: ^\S*$

Required: No

queries

An array of objects, each of which contains information about a query to submit to the reranker model.

Type: Array of RerankQuery objects

Array Members: Fixed number of 1 item.

Required: Yes

rerankingConfiguration

Contains configurations for reranking.

Type: RerankingConfiguration object

Required: Yes

sources

An array of objects, each of which contains information about the sources to rerank.

Type: Array of RerankSource objects

Array Members: Minimum number of 1 item. Maximum number of 1000 items.

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "nextToken": "string", "results": [ { "document": { "jsonDocument": JSON value, "textDocument": { "text": "string" }, "type": "string" }, "index": number, "relevanceScore": number } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

nextToken

If the total number of results is greater than can fit in the response, use this token in the nextToken field when making another request to return the next batch of results.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: ^\S*$

results

An array of objects, each of which contains information about the results of reranking.

Type: Array of RerankResult objects

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

The request is denied because of missing access permissions. Check your permissions and retry your request.

HTTP Status Code: 403

BadGatewayException

There was an issue with a dependency due to a server issue. Retry your request.

HTTP Status Code: 502

ConflictException

There was a conflict performing an operation. Resolve the conflict and retry your request.

HTTP Status Code: 409

DependencyFailedException

There was an issue with a dependency. Check the resource configurations and retry the request.

HTTP Status Code: 424

InternalServerException

An internal server error occurred. Retry your request.

HTTP Status Code: 500

ResourceNotFoundException

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

HTTP Status Code: 404

ServiceQuotaExceededException

The number of requests exceeds the service quota. Resubmit your request later.

HTTP Status Code: 400

ThrottlingException

The number of requests exceeds the limit. Resubmit your request later.

HTTP Status Code: 429

ValidationException

Input validation failed. Check your request parameters and retry the request.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

PrivacidadeTermos do sitePreferências de cookies
© 2025, Amazon Web Services, Inc. ou suas afiliadas. Todos os direitos reservados.