HTTP service for a self-hosted jina-reranker-m0 server.
The contract
POST {base_url}/v1/rerank:
{"query": "...", "documents": ["...", "..."],
"top_n": 5, "return_documents": false}answering
{"model": "...",
"results": [{"index": 0, "relevance_score": 0.28,
"document": {"text": "..."}}]}Results arrive ordered by descending score. document is nested under a
"text" key and only present when asked for; return_documents defaults to
true server-side, and this service sends false unless you opt in, because
:index already identifies the document and echoing a corpus back is waste.
Verified against a running deployment: the server rejects unknown body fields, requires at least one document, and caps a batch at 512.
Summary
Functions
Reorders documents by relevance to query.
Functions
@spec rerank( ExAgent.Providers.JinaRerankerM0.t(), String.t(), [String.t()], keyword() ) :: {:ok, ExAgent.Reranking.t()} | {:error, ExAgent.Error.t()}
Reorders documents by relevance to query.
Options
:model- overrides the provider's:modelin the request body:top_n- return only the bestn; the server still scores every document:return_documents- echo the document text back (defaultfalse)
Examples
ExAgent.rerank(provider, "who restarts processes?", chunks, top_n: 5)