BaseCohere Rerank Argument Mismatch #19461
-
Checked other resources
Commit to Help
Example Codefrom langchain.retrievers.document_compressors import CohereRerank
from langchain.retrievers import ContextualCompressionRetriever
import cohere
from cohere import Client
class CustomCohereRerank(CohereRerank):
class Config(CohereRerank.Config):
arbitrary_types_allowed = True
CustomCohereRerank.update_forward_refs()
compressor = CustomCohereRerank(cohere_api_key=os.environ["COHERE_API_KEY"],
client=Client,
top_n=4)
query = "How do you combine multiple adapters?"
compressed_docs = compression_retriever.get_relevant_documents(query)
pretty_print_docs(compressed_docs) DescriptionI am trying to use Langchain library to use Cohere Rerank by following this doc with HuggingFace LLM models, embeddings and FAISS db. A few days ago, It worked perfect and I obtained results but I am getting TypeError at these days:
The results that I obtained a few days ago: I have tried with some version combination of Cohere and LangChain to solve that but they did not work. System Infolangchain==0.1.11 cohere==5.1.1 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Based on the error message you provided, it seems like the The
The error message suggests that Here are some steps to troubleshoot and resolve the issue:
If after these steps the issue persists, consider providing more specific details about the For more information, you can refer to the Sources
|
Beta Was this translation helpful? Give feedback.
-
@robuno same problem, have you fixed it? |
Beta Was this translation helpful? Give feedback.
-
There's a PR here. #19486 I referenced this conversation but you all may want to comment. |
Beta Was this translation helpful? Give feedback.
-
Same problem |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It is working currently, latest package versions I checked:
|
Beta Was this translation helpful? Give feedback.
There's a PR here. #19486 I referenced this conversation but you all may want to comment.