Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chromadb/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ def _search(
searches: List[Search],
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
eventual_consistency: bool = False,
) -> SearchResult:
pass

Expand Down
1 change: 1 addition & 0 deletions chromadb/api/async_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ async def _search(
searches: List[Search],
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
eventual_consistency: bool = False,
) -> SearchResult:
pass

Expand Down
6 changes: 5 additions & 1 deletion chromadb/api/async_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,13 @@ async def _search(
searches: List[Search],
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
eventual_consistency: bool = False,
) -> SearchResult:
"""Performs hybrid search on a collection"""
payload = {"searches": [s.to_dict() for s in searches]}
payload = {
"searches": [s.to_dict() for s in searches],
"eventual_consistency": eventual_consistency,
}

resp_json = await self._make_request(
"post",
Expand Down
6 changes: 5 additions & 1 deletion chromadb/api/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,14 @@ def _search(
searches: List[Search],
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
eventual_consistency: bool = False,
) -> SearchResult:
"""Performs hybrid search on a collection"""
# Convert Search objects to dictionaries
payload = {"searches": [s.to_dict() for s in searches]}
payload = {
"searches": [s.to_dict() for s in searches],
"eventual_consistency": eventual_consistency,
}

resp_json = self._make_request(
"post",
Expand Down
2 changes: 2 additions & 0 deletions chromadb/api/models/AsyncCollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ async def fork(
async def search(
self,
searches: OneOrMany[Search],
eventual_consistency: bool = False,
) -> SearchResult:
"""Perform hybrid search on the collection.
This is an experimental API that only works for Hosted Chroma for now.
Expand Down Expand Up @@ -367,6 +368,7 @@ async def search(
searches=cast(List[Search], embedded_searches),
tenant=self.tenant,
database=self.database,
eventual_consistency=eventual_consistency,
)

async def update(
Expand Down
2 changes: 2 additions & 0 deletions chromadb/api/models/Collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def fork(
def search(
self,
searches: OneOrMany[Search],
eventual_consistency: bool = False,
) -> SearchResult:
"""Perform hybrid search on the collection.
This is an experimental API that only works for Hosted Chroma for now.
Expand Down Expand Up @@ -374,6 +375,7 @@ def search(
searches=cast(List[Search], embedded_searches),
tenant=self.tenant,
database=self.database,
eventual_consistency=eventual_consistency,
)

def update(
Expand Down
1 change: 1 addition & 0 deletions chromadb/api/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ def _search(
searches: List[Search],
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
eventual_consistency: bool = False,
) -> SearchResult:
raise NotImplementedError("Search is not implemented for Local Chroma")

Expand Down
1 change: 1 addition & 0 deletions chromadb/api/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ def _search(
searches: List[Search],
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
eventual_consistency: bool = False,
) -> SearchResult:
raise NotImplementedError("Search is not implemented for SegmentAPI")

Expand Down
Loading
Loading