WatsonxRerank is a wrapper for IBM watsonx.ai foundation models.This notebook shows how to use watsonx’s rerank endpoint in a retriever. This builds on top of ideas in the ContextualCompressionRetriever.
Class | Package | JS support | Package downloads | Package latest |
---|---|---|---|---|
WatsonxRerank | langchain-ibm | ✅ |
langchain-ibm
integration package.
langchain-ibm
package:
faiss
or faiss-cpu
package:
WatsonxEmbeddings
. For more details see WatsonxEmbeddings.
Note:
project_id
or space_id
. For more information see documentation.project_id
and Dallas url.
You need to specify model_id
that will be used for embedding. All available models you can find in documentation.
ContextualCompressionRetriever
. We’ll add an WatsonxRerank
, uses the watsonx rerank endpoint to rerank the returned results.
Do note that it is mandatory to specify the model name in WatsonxRerank!
ChatWatsonx
. For more details see ChatWatsonx.
WatsonxRerank
features and configurations head to the API reference.