Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: async local mode generator #345

Merged
merged 1 commit into from
Oct 20, 2023
Merged
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
34 changes: 22 additions & 12 deletions qdrant_client/async_qdrant_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from qdrant_client.async_qdrant_remote import AsyncQdrantRemote
from qdrant_client.conversions import common_types as types
from qdrant_client.http import AsyncApiClient, AsyncApis
from qdrant_client.local.async_qdrant_local import AsyncQdrantLocal


class AsyncQdrantClient(AsyncQdrantFastembedMixin):
Expand Down Expand Up @@ -70,6 +71,7 @@ class AsyncQdrantClient(AsyncQdrantFastembedMixin):

def __init__(
self,
location: Optional[str] = None,
url: Optional[str] = None,
port: Optional[int] = 6333,
grpc_port: int = 6334,
Expand All @@ -79,22 +81,30 @@ def __init__(
prefix: Optional[str] = None,
timeout: Optional[float] = None,
host: Optional[str] = None,
path: Optional[str] = None,
**kwargs: Any,
):
super().__init__(**kwargs)
self._client: AsyncQdrantBase
self._client = AsyncQdrantRemote(
url=url,
port=port,
grpc_port=grpc_port,
prefer_grpc=prefer_grpc,
https=https,
api_key=api_key,
prefix=prefix,
timeout=timeout,
host=host,
**kwargs,
)
if location == ":memory:":
self._client = AsyncQdrantLocal(location=location)
elif path is not None:
self._client = AsyncQdrantLocal(location=path)
else:
if location is not None and url is None:
url = location
self._client = AsyncQdrantRemote(
url=url,
port=port,
grpc_port=grpc_port,
prefer_grpc=prefer_grpc,
https=https,
api_key=api_key,
prefix=prefix,
timeout=timeout,
host=host,
**kwargs,
)
self._is_fastembed_installed: Optional[bool] = None
if self._is_fastembed_installed is None:
try:
Expand Down
Loading