mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-21 14:18:52 +00:00
core[patch]: Fix VectorStore's as_retriever mutating tags param (#22470)
The current VectorStore `as_retriever` implementation mutates the `tags` param when it's passed in kwargs. This fix ensures that a copy is done.
This commit is contained in:
parent
98b2e7b195
commit
23bba18f92
@ -646,9 +646,8 @@ class VectorStore(ABC):
|
||||
search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}}
|
||||
)
|
||||
"""
|
||||
tags = kwargs.pop("tags", None) or []
|
||||
tags.extend(self._get_retriever_tags())
|
||||
return VectorStoreRetriever(vectorstore=self, **kwargs, tags=tags)
|
||||
tags = kwargs.pop("tags", None) or [] + self._get_retriever_tags()
|
||||
return VectorStoreRetriever(vectorstore=self, tags=tags, **kwargs)
|
||||
|
||||
|
||||
class VectorStoreRetriever(BaseRetriever):
|
||||
|
Loading…
Reference in New Issue
Block a user