-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Issue: chroma retriever where_document parameter passed in search_kwargs is invalid #10082
Comments
🤖 Hello, Thank you for raising this issue. Based on the context provided, it seems that you are trying to use the Currently, the Here is an example of how you can use the chain = ConversationalRetrievalChain.from_llm(
OpenAI(temperature=0),
docsearch.as_retriever(search_kwargs={'filter': {'source':'pdfname'}}),
memory=memory
)
print(chain({'question':query})) If you need to search between multiple PDFs at once, you can pass the filter arguments along with the inputs object: filter = [ {'source':'pdf_name'}, {'source':'pdf_name2'} ]
print(chain ({"question" : question , 'filter' : filter}) However, if you want to filter by document contents, you might need to implement a custom solution. One possible workaround could be to retrieve all documents first, and then filter the results in Python using the I understand that this might not be the ideal solution, and having the In the meantime, I hope the above workaround can help you with your current needs. If you have any further questions or need more clarification, please feel free to ask. Best regards, Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
- Description: add where_document filter parameter in Chroma - Issue: [10082](#10082) - Dependencies: no - Tag maintainer: for a quicker response, tag the relevant maintainer (see below), - Twitter handle: no @hwchase17 --------- Co-authored-by: Jeremy Lai <jeremy_lai@wiwynn.com> Co-authored-by: Bagatur <baskaryan@gmail.com>
Hi, @PTTrazavi! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that I'll be marking this issue as stale. From what I understand, you raised an issue stating that the "where_document" parameter does not work when using chroma db as a retriever in ConversationalRetrievalChain. Dosubot responded, explaining that the ConversationalRetrievalChain currently only supports the "filter" parameter for metadata filtering, not the "where_document" filter for document contents. Dosubot provided a workaround and mentioned that they will raise this as a feature request to the LangChain development team. If this issue is still relevant to the latest version of the LangChain repository, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself. If there's no further activity, the issue will be automatically closed in 7 days. Thank you for your contribution to the LangChain repository! If you have any other questions or need further assistance, feel free to ask. |
@dosu-bot is there any way using which I can add a filter for all the documents stored in multiple directories dynamically |
Issue you'd like to raise.
I am using chroma db as retriever in ConversationalRetrievalChain, but the parameter "where_document" does not work.
In chroma official site chroma, it says:
Chroma supports filtering queries by metadata and document contents. The where filter is used to filter by metadata, and the where_document filter is used to filter by document contents.
Suggestion:
can ConversationalRetrievalChain support where_document filter for chroma db?
The text was updated successfully, but these errors were encountered: