fixed similarity search with score error #29407 (#29413)

Description: Fix TypeError in AzureSearch similarity_search_with_score
by removing search_type from kwargs before passing to underlying
requests.

This resolves issue #29407 where search_type was being incorrectly
passed through to Session.request().
Issue: #29407

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Mohammad Anash 2025-01-28 02:04:42 +05:30 committed by GitHub
parent 7b404fcd37
commit aba1fd0bd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -683,7 +683,8 @@ class AzureSearch(VectorStore):
self, query: str, *, k: int = 4, **kwargs: Any
) -> List[Tuple[Document, float]]:
"""Run similarity search with distance."""
search_type = kwargs.get("search_type", self.search_type)
# Extract search_type from kwargs, defaulting to self.search_type
search_type = kwargs.pop("search_type", self.search_type)
if search_type == "similarity":
return self.vector_search_with_score(query, k=k, **kwargs)
elif search_type == "hybrid":