Skip to content

Commit

Permalink
fixed similarity search with score error #29407 (#29413)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Anash3 and ccurme authored Jan 27, 2025
1 parent 7b404fc commit aba1fd0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ def similarity_search_with_score(
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":
Expand Down

0 comments on commit aba1fd0

Please sign in to comment.