Skip to main content

OpenAI Reranker (Experimental)

This reranker uses OpenAI chat model to rerank the search results. You can use this reranker by passing OpenaiReranker() to the rerank() method.
Note: Supported query types: Hybrid, Vector, and FTS.
Warning: This reranker is experimental. OpenAI does not have a dedicated reranking model, so it uses a chat model under the hood.
Replace your-api-key with your provider API key. In application code, load credentials from environment variables or a secrets manager.

Accepted Arguments

Supported Scores for each query type

You can specify the type of scores you want the reranker to return. The following are the supported scores for each query type: