ReferenzLLM
Order documents by relevance to a query.
POST
Calls a model of type rerank in the Cohere Rerank format.
apiKeyheader
X-API-Key<token>API key issued in the Galilea settings.
application/json- body
Orders documents by their relevance to a query, in the Cohere Rerank format.
model*stringThe key of a model of type rerank.
query*stringdocuments*array<string>top_n?integerAnswer only the most relevant documents, at most this many.
[key: string]?anyThe documents by relevance.
application/json- response
id?stringresults*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 } ]}