Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis committed Dec 16, 2024
1 parent e66a4da commit 414c30e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libs/core/langchain_core/vectorstores/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,9 @@ def validate_search_type(cls, values: dict) -> Any:
def _get_ls_params(self, **kwargs: Any) -> LangSmithRetrieverParams:
"""Get standard params for tracing."""

ls_params = super()._get_ls_params(**kwargs)
_kwargs = self.search_kwargs | kwargs

ls_params = super()._get_ls_params(_kwargs)
ls_params["ls_vector_store_provider"] = self.vectorstore.__class__.__name__

if self.vectorstore.embeddings:
Expand All @@ -1076,7 +1078,7 @@ def _get_ls_params(self, **kwargs: Any) -> LangSmithRetrieverParams:
def _get_relevant_documents(
self, query: str, *, run_manager: CallbackManagerForRetrieverRun, **kwargs: Any
) -> list[Document]:
_kwargs = {**self.search_kwargs, **kwargs}
_kwargs = self.search_kwargs | kwargs
if self.search_type == "similarity":
docs = self.vectorstore.similarity_search(query, **_kwargs)
elif self.search_type == "similarity_score_threshold":
Expand All @@ -1100,7 +1102,7 @@ async def _aget_relevant_documents(
run_manager: AsyncCallbackManagerForRetrieverRun,
**kwargs: Any,
) -> list[Document]:
_kwargs = {**self.search_kwargs, **kwargs}
_kwargs = self.search_kwargs | kwargs
if self.search_type == "similarity":
docs = await self.vectorstore.asimilarity_search(query, **_kwargs)
elif self.search_type == "similarity_score_threshold":
Expand Down

0 comments on commit 414c30e

Please sign in to comment.