Dokumentation
ReferenzLLM

Order documents by relevance to a query.

POST
/llm/rerank

Calls a model of type rerank in the Cohere Rerank format.

Authorization

apiKey
headerX-API-Key<token>

API key issued in the Galilea settings.

Request Body

application/json
  1. body

Orders documents by their relevance to a query, in the Cohere Rerank format.

model*string

The key of a model of type rerank.

query*string
documents*array<string>
top_n?integer

Answer only the most relevant documents, at most this many.

[key: string]?any

Response Body

The documents by relevance.

application/json
  1. response
id?string
results*array<>

The documents by relevance, most relevant first; index is the position in the request.

curl -X POST "https://example.com/llm/rerank" \  -H "Content-Type: application/json" \  -d '{    "model": "cohere-rerank-v4.0-fast",    "query": "Wie beantrage ich Urlaub?",    "documents": [      "Reisekosten werden über das Portal abgerechnet.",      "Urlaub beantragst du im Personalportal unter Abwesenheiten."    ]  }'
{  "id": "55242087-e231-4729-a177-3bdcbbefa6f5",  "results": [    {      "index": 1,      "relevance_score": 0.78    },    {      "index": 0,      "relevance_score": 0.5    }  ]}