Skip to main content

Watsonx Reranker

This reranker uses the IBM watsonx.ai text rerank API to reorder search results. Pass WatsonxReranker() to the rerank() method on a query. Credentials come from the WATSONX_API_KEY and WATSONX_PROJECT_ID (or WATSONX_SPACE_ID) environment variables, or can be passed explicitly as arguments.
Note: Supported query types – Hybrid, Vector, and FTS.

Accepted Arguments

You must supply exactly one of project_id or space_id (either as an argument or via its environment variable). Setting both, or neither, raises a ValueError.

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: