-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Added kwargs parameter for retrievers and text to SQL pipeline using DSPy #721
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
Conversation
|
This is awesome!! 🔥 @Athe-kunal any chance you would also be interested in taking a look at this - #560? I see you have also updated the P.S. Please note Weaviate can also take **kwargs to interface metadata filters such as: import weaviate.classes as wvc
jeopardy = client.collections.get("JeopardyQuestion")
response = jeopardy.query.hybrid(
query="food",
filters=wvc.query.Filter.by_property("round").equal("Double Jeopardy!"),
limit=3
)
for o in response.objects:
print(o.properties) |
|
Hi @CShorten Coming to PR, the retrieve pipeline just returns the long_text key. In |
|
Thank you so much for the kind words, it means a lot! Ok fantastic, I think we are good to merge this one adding **kwargs, and maybe we can continue our discussion of the |
|
@hsm207 maybe you will find this one interesting on the use of |
|
the docstring in the WeaviateRM's forward method need to be updated too to document that kwargs param and that all of it will be passed to the client's |
|
Yes, we need to have documentation for all the retrievers and what extra parameters they can take. Some of the retrievers have some inputs in the |
Just had a look at some other retrievers and I see what you mean. There are solutions we can consider but they would require a major refactoring which I don't think is appropriate at this stage of the project. But good that you brought this up. Maybe the maintainers can put it in their backlog. |
|
Yeah sure. |
Josephrp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A great example for a popular use case of DSPy
|
the code looks good to me. |
|
Yeah sure @Josephrp, please provide your feedback |
|
Lgtm, tested with: |
|
Having trouble with Have you tested that this works @Athe-kunal? Will dive in further tomorrow. |
|
Apologies this error was caused by how I was testing. Confirming, |
All the retrievers support metadata filtering arguments, which can be passed during
dspy.Retrieve(k=num_passages)as**kwargs. This PR add just the**kwargsparameter to retriever which can be passed to the retriever client and we can sample passages based on metadata. For example in ChromaDB, we haveWe will only retrieve documents for the given book source and send to reranker or model for next stages in the pipeline