POST
/
v4
/
chunks
/
rank

Authorizations

x-api-key
string
headerrequired

Body

application/json
query
string
required

Natural language query to re-rank chunks against. If a vector store query was originally used to retrieve these chunks, please use the same query for this ranking

relevant_chunks
object[]
required

List of chunks to rank

rank_strategy
object
required

The ranking strategy to use.

Rank strategies determine how the ranking is done, They consist of the ranking method name and additional params needed to compute the ranking.

Use the built-in cross_encoder or rouge strategies or create a custom one with the Models API.

top_k
integer

Number of chunks to return. Must be greater than 0 if specified. If not specified, all chunks will be returned.

account_id
string

Account to rank chunks with. If you have access to more than one account, you must specify an account_id

Response

200 - application/json
relevant_chunks
object[]
required

List of chunks ranked by the requested rank strategy