-
Notifications
You must be signed in to change notification settings - Fork 16.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
community: add top_k as param to Needle Retriever #29821
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@efriis Hey man, adding a small detail here. Should be an easy to merge PR. Just adding the |
@@ -45,6 +47,9 @@ class NeedleRetriever(BaseRetriever, BaseModel): | |||
collection_id: Optional[str] = Field( | |||
..., description="The ID of the Needle collection to search in" | |||
) | |||
top_k: Optional[int] = Field( | |||
default=10, description="Maximum number of search results to return" |
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.
Why not set default as None, as in the client?
Won't this change behavior for existing users?
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.
Yes you are right. I will adjust, appreciate the comment.
Thank you for contributing to LangChain!
PR title: "package: description"
PR message:
This PR adds top_k as a param to the Needle Retriever. By default we use top 10.
Add tests and docs: If you're adding a new integration, please include
docs/docs/integrations
directory.Lint and test: Run
make format
,make lint
andmake test
from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/Additional guidelines:
If no one reviews your PR within a few days, please @-mention one of baskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.