Skip to content

Commit

Permalink
remove asymmetric search convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
ivo-1 committed Apr 24, 2024
1 parent d30ef8b commit 048c050
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
17 changes: 0 additions & 17 deletions src/intelligence_layer/connectors/document_index/document_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,23 +570,6 @@ def search(
self._raise_for_status(response)
return [DocumentSearchResult._from_search_response(r) for r in response.json()]

def asymmetric_search(
self,
collection_path: CollectionPath,
search_query: SearchQuery,
) -> Sequence[DocumentSearchResult]:
"""Search through a collection with a `search_query` using the asymmetric search configuration.
Args:
collection_path: Path to the collection of interest.
search_query: The query to search with.
Returns:
Result of the search operation. Will be empty if nothing was retrieved.
"""

return self.search(collection_path, "asymmetric", search_query)

def _raise_for_status(self, response: requests.Response) -> None:
try:
response.raise_for_status()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def get_relevant_documents_with_scores(
search_query = SearchQuery(
query=query, max_results=self._k, min_score=self._threshold
)
response = self._document_index.asymmetric_search(
self._collection_path, search_query
response = self._document_index.search(
self._collection_path, "asymmetric", search_query
)
relevant_chunks = [
SearchResult(
Expand Down
4 changes: 2 additions & 2 deletions tests/connectors/document_index/test_document_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def test_document_index_searches_asymmetrically(
document_name="test_document_index_searches_asymmetrically", # is always there
)
search_query = SearchQuery(query="Who likes pizza?", max_results=1, min_score=0.0)
search_result = document_index.asymmetric_search(
document_path.collection_path, search_query
search_result = document_index.search(
document_path.collection_path, "asymmetric", search_query
)

assert "Mark" in search_result[0].section
Expand Down

0 comments on commit 048c050

Please sign in to comment.