الانتقال إلى المحتوى الرئيسي
POST
Rerank documents (Cohere- and vLLM-compatible)

التفويضات

Authorization
string
header
مطلوب

A key from conare.ai/dashboard/keys with full access, some namespaces, or models only (/embed, /rerank, /v1, /v2/rerank, /parse).

الجسم

application/json
query
string
مطلوب
Minimum string length: 1
documents
(string | object)[]
مطلوب

Up to 100 strings or { text } objects (1,000 on a custom reranker).

Required array length: 1 - 1000 elements
model
string

Omit for the default reranker.

top_n
integer

Return only the best top_n. Default all.

النطاق المطلوب: x >= 0
return_documents
boolean
افتراضي:false

Add each result's document text, as sent.

max_tokens_per_doc
integer

Truncate each document to about this many tokens (4 characters each). 0 is no limit.

النطاق المطلوب: x >= 0

الاستجابة

Scores, best first. index points into the request's documents.

id
string
مطلوب

The request id.

model
string
مطلوب
results
object[]
مطلوب
unscored
integer[]
مطلوب

Indexes of documents that were not scored. Usually empty.

usage
object
مطلوب