-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
[Community]: AzureSearchVectorStoreRetriever Fixed to account for search_kwargs #21572
[Community]: AzureSearchVectorStoreRetriever Fixed to account for search_kwargs #21572
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@baskaryan please review |
elif self.search_type == "similarity_score_threshold": | ||
docs = [ | ||
doc | ||
for doc, _ in self.vectorstore.similarity_search_with_relevance_scores( | ||
query, k=self.k, **kwargs | ||
query, k=self.k, **self.search_kwargs, **kwargs |
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.
Same as above here (and below). Defining params
before the if
clause would be much cleaner.
Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com>
@mspronesti I have made your changes. Please check |
@keenborder786 Thanks for taking my suggestion into consideration -- guess you forgot to apply these changes in the last 3 |
@baskaryan, @efriis, @eyurtsev, @hwchase17 please review |
…angchain into azure_search_fix
@keenborder786 There's a small conflict which arose from my latest PR being merged. Resolving it should only require replacing @ccurme Could you please review this as well? :) |
okay, I will resolve it. |
@mspronesti fixed |
@eyurtsev please see |
@@ -740,6 +739,18 @@ class AzureSearchVectorStoreRetriever(BaseRetriever): | |||
or "semantic_hybrid_score_threshold".""" | |||
k: int = 4 | |||
"""Number of documents to return.""" | |||
search_kwargs: dict = Field( | |||
default_factory=lambda: {"fetch_k": 20, "lambda_mult": 0.5} |
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.
can we just default to empty dict here and let vecstore set defaults?
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.
@baskaryan done
…r search_kwargs (langchain-ai#21572) - **Description:** Fixed `AzureSearchVectorStoreRetriever` to account for search_kwargs. More explanation is in the mentioned issue. - **Issue:** langchain-ai#21492 --------- Co-authored-by: MAC <mac@MACs-MacBook-Pro.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Bagatur <baskaryan@gmail.com>
AzureSearchVectorStoreRetriever
to account for search_kwargs. More explanation is in the mentioned issue.