[X] I added a very descriptive title to this issue.
[X] I searched the LangChain documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangChain rather than my code.
[X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
Missing __search_kwargs: dict = Field(defaultfactory=dict) fields in AzureSearchVectorStoreRetriever, we can't pass filter condition during query from vector db
Current code:
class AzureSearchVectorStoreRetriever(BaseRetriever):
"""Retriever that uses `Azure Cognitive Search`."""
vectorstore: AzureSearch
"""Azure Search instance used to find similar documents."""
search_type: str = "hybrid"
"""Type of search to perform. Options are "similarity", "hybrid",
"semantic_hybrid", "similarity_score_threshold", "hybrid_score_threshold"."""
k: int = 4
"""Number of documents to return."""
allowed_search_types: ClassVar[Collection[str]] = (
)
Previous Code:
class VectorStoreRetriever(BaseRetriever):
"""Base Retriever class for VectorStore."""
vectorstore: VectorStore
"""VectorStore to use for retrieval."""
search_type: str = "similarity"
"""Type of search to perform. Defaults to "similarity"."""
_search_kwargs: dict = Field(default_factory=dict)
"""Keyword arguments to pass to the search function."""
allowed_search_types: ClassVar[Collection[str]] = (
"similarity",
"similarity_score_threshold",
"mmr",
)
Error Message and Stack Trace (if applicable)
No response
Description
Can't pass filter expression to azure search
System Info
langchain-community==0.0.32 works well but in langchain-community==0.0.37 failed to get filter conditions
Checked other resources
Example Code
Missing __search_kwargs: dict = Field(defaultfactory=dict) fields in AzureSearchVectorStoreRetriever, we can't pass filter condition during query from vector db
Current code:
Previous Code:
Error Message and Stack Trace (if applicable)
No response
Description
Can't pass filter expression to azure search
System Info
langchain-community==0.0.32 works well but in langchain-community==0.0.37 failed to get filter conditions