-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CohereAPIError thrown when base retriever returns empty documents in ContextualCompressionRetriever using Cohere Rank #5304
Comments
good catch! happy to review if you want to open a fix, otherwise can get to it this weekend |
ah see you already opened! |
hwchase17
pushed a commit
that referenced
this issue
May 28, 2023
…5304) (#5306) # Fix: Handle empty documents in ContextualCompressionRetriever (Issue #5304) Fixes #5304 Prevent cohere.error.CohereAPIError caused by an empty list of documents by adding a condition to check if the input documents list is empty in the compress_documents method. If the list is empty, return an empty list immediately, avoiding the error and unnecessary processing. @dev2049 --------- Co-authored-by: Dev 2049 <[email protected]>
Merged
Undertone0809
pushed a commit
to Undertone0809/langchain
that referenced
this issue
Jun 19, 2023
…angchain-ai#5304) (langchain-ai#5306) # Fix: Handle empty documents in ContextualCompressionRetriever (Issue langchain-ai#5304) Fixes langchain-ai#5304 Prevent cohere.error.CohereAPIError caused by an empty list of documents by adding a condition to check if the input documents list is empty in the compress_documents method. If the list is empty, return an empty list immediately, avoiding the error and unnecessary processing. @dev2049 --------- Co-authored-by: Dev 2049 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System Info
Who can help?
No response
Information
Related Components
Reproduction
Code is Like
Expected behavior
no error throws and return empty list
The text was updated successfully, but these errors were encountered: