weaviate.connect package
Module communication to a Weaviate instance. Used to connect to Weaviate and run REST requests.
- pydantic model weaviate.connect.ConnectionParams[source]
Bases:
BaseModel
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- field grpc: ProtocolParams [Required]
- Validated by:
_check_port_collision
- field http: ProtocolParams [Required]
- Validated by:
_check_port_collision
- classmethod from_params(http_host: str, http_port: int, http_secure: bool, grpc_host: str, grpc_port: int, grpc_secure: bool) ConnectionParams [source]
- classmethod from_url(url: str, grpc_port: int, grpc_secure: bool = False) ConnectionParams [source]
- class weaviate.connect.ConnectionV4(connection_params: ConnectionParams, auth_client_secret: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None, timeout_config: Timeout, proxies: str | Proxies | None, trust_env: bool, additional_headers: Dict[str, Any] | None, connection_config: ConnectionConfig, loop: AbstractEventLoop, embedded_db: EmbeddedV4 | None = None)[source]
Bases:
object
Connection class used to communicate to a weaviate instance.
- property additional_headers: Dict[str, str]
- async delete(path: str, weaviate_object: Mapping[str, Any] | Sequence[Any] | None = None, params: Dict[str, Any] | None = None, error_msg: str = '', status_codes: _ExpectedStatusCodes | None = None) Response [source]
- async get(path: str, params: Dict[str, Any] | None = None, error_msg: str = '', status_codes: _ExpectedStatusCodes | None = None) Response [source]
- property grpc_stub: WeaviateStub | None
- async head(path: str, params: Dict[str, Any] | None = None, error_msg: str = '', status_codes: _ExpectedStatusCodes | None = None) Response [source]
- async patch(path: str, weaviate_object: Mapping[str, Any] | Sequence[Any], params: Dict[str, Any] | None = None, error_msg: str = '', status_codes: _ExpectedStatusCodes | None = None) Response [source]
- async post(path: str, weaviate_object: Mapping[str, Any] | Sequence[Any], params: Dict[str, Any] | None = None, error_msg: str = '', status_codes: _ExpectedStatusCodes | None = None, is_gql_query: bool = False) Response [source]
- async put(path: str, weaviate_object: Mapping[str, Any] | Sequence[Any], params: Dict[str, Any] | None = None, error_msg: str = '', status_codes: _ExpectedStatusCodes | None = None) Response [source]
- property server_version: str
Version of the weaviate instance.
- async wait_for_weaviate(startup_period: int) None [source]
Waits until weaviate is ready or the time limit given in ‘startup_period’ has passed.
Parameters
- startup_periodint
Describes how long the client will wait for weaviate to start in seconds.
Raises
- WeaviateStartUpError
If weaviate takes longer than the time limit to respond.
- pydantic model weaviate.connect.ProtocolParams[source]
Bases:
BaseModel
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- field host: str [Required]
- Validated by:
_check_host
- field port: int [Required]
- Validated by:
_check_port
- field secure: bool [Required]
Submodules
weaviate.connect.authentication module
weaviate.connect.connection module
weaviate.connect.helpers module
Helper functions for creating new WeaviateClient or WeaviateAsyncClient instances in common scenarios.
- weaviate.connect.helpers.connect_to_custom(http_host: str, http_port: int, http_secure: bool, grpc_host: str, grpc_port: int, grpc_secure: bool, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, auth_credentials: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None = None, skip_init_checks: bool = False) WeaviateClient [source]
Connect to a Weaviate instance with custom connection parameters.
If this is not sufficient for your customization needs then instantiate a weaviate.WeaviateClient instance directly.
This method handles automatically connecting to Weaviate but not automatically closing the connection. Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in a with statement, which will automatically close the connection when the context is exited. See the examples below for details.
- Arguments:
- http_host
The host to use for the underlying REST and GraphQL API calls.
- http_port
The port to use for the underlying REST and GraphQL API calls.
- http_secure
Whether to use https for the underlying REST and GraphQL API calls.
- grpc_host
The host to use for the underlying gRPC API.
- grpc_port
The port to use for the underlying gRPC API.
- grpc_secure
Whether to use a secure channel for the underlying gRPC API.
- headers
Additional headers to include in the requests, e.g. API keys for Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- auth_credentials
The credentials to use for authentication with your Weaviate instance. This can be an API key, in which case use weaviate.classes.init.Auth.api_key(), a bearer token, in which case use weaviate.classes.init.Auth.bearer_token(), a client secret, in which case use weaviate.classes.init.Auth.client_credentials() or a username and password, in which case use weaviate.classes.init.Auth.client_password().
- skip_init_checks
Whether to skip the initialization checks when connecting to Weaviate.
- Returns
- weaviate.WeaviateClient
The client connected to the instance with the required parameters set appropriately.
- Examples:
>>> ################## Without Context Manager ############################# >>> import weaviate >>> client = weaviate.connect_to_custom( ... http_host="localhost", ... http_port=8080, ... http_secure=False, ... grpc_host="localhost", ... grpc_port=50051, ... grpc_secure=False, ... ) >>> client.is_ready() True >>> client.close() # Close the connection when you are done with it. >>> ################## With Context Manager ############################# >>> import weaviate >>> with weaviate.connect_to_custom( ... http_host="localhost", ... http_port=8080, ... http_secure=False, ... grpc_host="localhost", ... grpc_port=50051, ... grpc_secure=False, ... ) as client: ... client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.connect_to_embedded(hostname: str = '127.0.0.1', port: int = 8079, grpc_port: int = 50050, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, version: str = '1.26.6', persistence_data_path: str | None = None, binary_path: str | None = None, environment_variables: Dict[str, str] | None = None) WeaviateClient [source]
Connect to an embedded Weaviate instance.
This method handles automatically connecting to Weaviate but not automatically closing the connection. Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in a with statement, which will automatically close the connection when the context is exited. See the examples below for details.
See [the docs](https://weaviate.io/developers/weaviate/installation/embedded#embedded-options) for more details.
- Arguments:
- hostname
The hostname to use for the underlying REST & GraphQL API calls.
- port
The port to use for the underlying REST and GraphQL API calls.
- grpc_port
The port to use for the underlying gRPC API.
- headers
Additional headers to include in the requests, e.g. API keys for Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- version
Weaviate version to be used for the embedded instance.
- persistence_data_path
Directory where the files making up the database are stored. When the XDG_DATA_HOME env variable is set, the default value is: XDG_DATA_HOME/weaviate/ Otherwise it is: ~/.local/share/weaviate
- binary_path
Directory where to download the binary. If deleted, the client will download the binary again. When the XDG_CACHE_HOME env variable is set, the default value is: XDG_CACHE_HOME/weaviate-embedded/ Otherwise it is: ~/.cache/weaviate-embedded
- environment_variables
Additional environment variables to be passed to the embedded instance for configuration.
- Returns
- weaviate.WeaviateClient
The client connected to the embedded instance with the required parameters set appropriately.
- Examples:
>>> import weaviate >>> client = weaviate.connect_to_embedded( ... port=8080, ... grpc_port=50051, ... ) >>> client.is_ready() True >>> client.close() # Close the connection when you are done with it. ################## With Context Manager ############################# >>> import weaviate >>> with weaviate.connect_to_embedded( ... port=8080, ... grpc_port=50051, ... ) as client: ... client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.connect_to_local(host: str = 'localhost', port: int = 8080, grpc_port: int = 50051, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, skip_init_checks: bool = False, auth_credentials: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None = None) WeaviateClient [source]
Connect to a local Weaviate instance deployed using Docker compose with standard port configurations.
This method handles automatically connecting to Weaviate but not automatically closing the connection. Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in a with statement, which will automatically close the connection when the context is exited. See the examples below for details.
- Arguments:
- host
The host to use for the underlying REST and GraphQL API calls.
- port
The port to use for the underlying REST and GraphQL API calls.
- grpc_port
The port to use for the underlying gRPC API.
- headers
Additional headers to include in the requests, e.g. API keys for Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- skip_init_checks
Whether to skip the initialization checks when connecting to Weaviate.
- auth_credentials
The credentials to use for authentication with your Weaviate instance. This can be an API key, in which case use weaviate.classes.init.Auth.api_key(), a bearer token, in which case use weaviate.classes.init.Auth.bearer_token(), a client secret, in which case use weaviate.classes.init.Auth.client_credentials() or a username and password, in which case use weaviate.classes.init.Auth.client_password().
- Returns
- weaviate.WeaviateClient
The client connected to the local instance with default parameters set as:
- Examples:
>>> ################## Without Context Manager ############################# >>> import weaviate >>> client = weaviate.connect_to_local( ... host="localhost", ... port=8080, ... grpc_port=50051, ... ) >>> client.is_ready() True >>> client.close() # Close the connection when you are done with it. >>> ################## With Context Manager ############################# >>> import weaviate >>> with weaviate.connect_to_local( ... host="localhost", ... port=8080, ... grpc_port=50051, ... ) as client: ... client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.connect_to_wcs(cluster_url: str, auth_credentials: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, skip_init_checks: bool = False) WeaviateClient [source]
Connect to a Weaviate Cloud (WCD) instance. This method is deprecated and will be removed in a future release. Use connect_to_weaviate_cloud instead.
This method handles automatically connecting to Weaviate but not automatically closing the connection. Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in a with statement, which will automatically close the connection when the context is exited. See the examples below for details.
- Arguments:
- cluster_url
The WCD cluster URL or hostname to connect to. Usually in the form: rAnD0mD1g1t5.something.weaviate.cloud
- auth_credentials
The credentials to use for authentication with your Weaviate instance. This can be an API key, in which case use weaviate.classes.init.Auth.api_key(), a bearer token, in which case use weaviate.classes.init.Auth.bearer_token(), a client secret, in which case use weaviate.classes.init.Auth.client_credentials() or a username and password, in which case use weaviate.classes.init.Auth.client_password().
- headers
Additional headers to include in the requests, e.g. API keys for third-party Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- skip_init_checks
Whether to skip the initialization checks when connecting to Weaviate.
- Returns
- weaviate.WeaviateClient
The client connected to the cluster with the required parameters set appropriately.
- Examples:
>>> import weaviate >>> client = weaviate.connect_to_wcs( ... cluster_url="rAnD0mD1g1t5.something.weaviate.cloud", ... auth_credentials=weaviate.classes.init.Auth.api_key("my-api-key"), ... ) >>> client.is_ready() True >>> client.close() # Close the connection when you are done with it. ################## With Context Manager ############################# >>> import weaviate >>> with weaviate.connect_to_wcs( ... cluster_url="rAnD0mD1g1t5.something.weaviate.cloud", ... auth_credentials=weaviate.classes.init.Auth.api_key("my-api-key"), ... ) as client: ... client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.connect_to_weaviate_cloud(cluster_url: str, auth_credentials: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, skip_init_checks: bool = False) WeaviateClient [source]
Connect to a Weaviate Cloud (WCD) instance.
This method handles automatically connecting to Weaviate but not automatically closing the connection. Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in a with statement, which will automatically close the connection when the context is exited. See the examples below for details.
- Arguments:
- cluster_url
The WCD cluster URL or hostname to connect to. Usually in the form: rAnD0mD1g1t5.something.weaviate.cloud
- auth_credentials
The credentials to use for authentication with your Weaviate instance. This can be an API key, in which case use weaviate.classes.init.Auth.api_key(), a bearer token, in which case use weaviate.classes.init.Auth.bearer_token(), a client secret, in which case use weaviate.classes.init.Auth.client_credentials() or a username and password, in which case use weaviate.classes.init.Auth.client_password().
- headers
Additional headers to include in the requests, e.g. API keys for third-party Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- skip_init_checks
Whether to skip the initialization checks when connecting to Weaviate.
- Returns
- weaviate.WeaviateClient
The client connected to the cluster with the required parameters set appropriately.
- Examples:
>>> ################## Without Context Manager ############################# >>> import weaviate >>> client = weaviate.connect_to_weaviate_cloud( ... cluster_url="rAnD0mD1g1t5.something.weaviate.cloud", ... auth_credentials=weaviate.classes.init.Auth.api_key("my-api-key"), ... ) >>> client.is_ready() True >>> client.close() # Close the connection when you are done with it. >>> ################## With Context Manager ############################# >>> import weaviate >>> with weaviate.connect_to_weaviate_cloud( ... cluster_url="rAnD0mD1g1t5.something.weaviate.cloud", ... auth_credentials=weaviate.classes.init.Auth.api_key("my-api-key"), ... ) as client: ... client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.use_async_with_custom(http_host: str, http_port: int, http_secure: bool, grpc_host: str, grpc_port: int, grpc_secure: bool, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, auth_credentials: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None = None, skip_init_checks: bool = False) WeaviateAsyncClient [source]
Create an async client object ready to connect to a Weaviate instance with custom connection parameters.
If this is not sufficient for your customization needs then instantiate a weaviate.WeaviateAsyncClient instance directly.
This method handles creating the WeaviateAsyncClient instance with relevant options to Weaviate Cloud connections but you must manually call await client.connect(). Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in an async with statement, which will automatically open/close the connection when the context is entered/exited. See the examples below for details.
- Arguments:
- http_host
The host to use for the underlying REST and GraphQL API calls.
- http_port
The port to use for the underlying REST and GraphQL API calls.
- http_secure
Whether to use https for the underlying REST and GraphQL API calls.
- grpc_host
The host to use for the underlying gRPC API.
- grpc_port
The port to use for the underlying gRPC API.
- grpc_secure
Whether to use a secure channel for the underlying gRPC API.
- headers
Additional headers to include in the requests, e.g. API keys for Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- auth_credentials
The credentials to use for authentication with your Weaviate instance. This can be an API key, in which case use weaviate.classes.init.Auth.api_key(), a bearer token, in which case use weaviate.classes.init.Auth.bearer_token(), a client secret, in which case use weaviate.classes.init.Auth.client_credentials() or a username and password, in which case use weaviate.classes.init.Auth.client_password().
- skip_init_checks
Whether to skip the initialization checks when connecting to Weaviate.
- Returns
- weaviate.WeaviateClient
The client connected to the instance with the required parameters set appropriately.
- Examples:
>>> ################## Without Context Manager ############################# >>> import weaviate >>> client = weaviate.use_async_with_custom( ... http_host="localhost", ... http_port=8080, ... http_secure=False, ... grpc_host="localhost", ... grpc_port=50051, ... grpc_secure=False, ... ) >>> await client.is_ready() False # The connection is not ready yet, you must call `await client.connect()` to connect. ... await client.connect() >>> await client.is_ready() True >>> await client.close() # Close the connection when you are done with it. >>> ################## Async With Context Manager ############################# >>> import weaviate >>> async with weaviate.use_async_with_custom( ... http_host="localhost", ... http_port=8080, ... http_secure=False, ... grpc_host="localhost", ... grpc_port=50051, ... grpc_secure=False, ... ) as client: ... await client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.use_async_with_embedded(hostname: str = '127.0.0.1', port: int = 8079, grpc_port: int = 50050, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, version: str = '1.26.6', persistence_data_path: str | None = None, binary_path: str | None = None, environment_variables: Dict[str, str] | None = None) WeaviateAsyncClient [source]
Create an async client object ready to connect to an embedded Weaviate instance.
If this is not sufficient for your customization needs then instantiate a weaviate.WeaviateAsyncClient instance directly.
This method handles creating the WeaviateAsyncClient instance with relevant options to Weaviate Cloud connections but you must manually call await client.connect(). Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in an async with statement, which will automatically open/close the connection when the context is entered/exited. See the examples below for details.
See [the docs](https://weaviate.io/developers/weaviate/installation/embedded#embedded-options) for more details.
- Arguments:
- hostname
The hostname to use for the underlying REST & GraphQL API calls.
- port
The port to use for the underlying REST and GraphQL API calls.
- grpc_port
The port to use for the underlying gRPC API.
- headers
Additional headers to include in the requests, e.g. API keys for Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- version
Weaviate version to be used for the embedded instance.
- persistence_data_path
Directory where the files making up the database are stored. When the XDG_DATA_HOME env variable is set, the default value is: XDG_DATA_HOME/weaviate/ Otherwise it is: ~/.local/share/weaviate
- binary_path
Directory where to download the binary. If deleted, the client will download the binary again. When the XDG_CACHE_HOME env variable is set, the default value is: XDG_CACHE_HOME/weaviate-embedded/ Otherwise it is: ~/.cache/weaviate-embedded
- environment_variables
Additional environment variables to be passed to the embedded instance for configuration.
- Returns
- weaviate.WeaviateClient
The client connected to the embedded instance with the required parameters set appropriately.
- Examples:
>>> import weaviate >>> client = weaviate.use_async_with_embedded( ... port=8080, ... grpc_port=50051, ... ) >>> await client.is_ready() False # The connection is not ready yet, you must call `await client.connect()` to connect. ... await client.connect() >>> await client.is_ready() True ################## With Context Manager ############################# >>> import weaviate >>> async with weaviate.use_async_with_embedded( ... port=8080, ... grpc_port=50051, ... ) as client: ... await client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.use_async_with_local(host: str = 'localhost', port: int = 8080, grpc_port: int = 50051, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, skip_init_checks: bool = False, auth_credentials: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None = None) WeaviateAsyncClient [source]
Create an async client object ready to connect to a local Weaviate instance deployed using Docker compose with standard port configurations.
This method handles creating the WeaviateAsyncClient instance with relevant options to Weaviate Cloud connections but you must manually call await client.connect(). Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in an async with statement, which will automatically open/close the connection when the context is entered/exited. See the examples below for details.
- Arguments:
- host
The host to use for the underlying REST and GraphQL API calls.
- port
The port to use for the underlying REST and GraphQL API calls.
- grpc_port
The port to use for the underlying gRPC API.
- headers
Additional headers to include in the requests, e.g. API keys for Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- skip_init_checks
Whether to skip the initialization checks when connecting to Weaviate.
- auth_credentials
The credentials to use for authentication with your Weaviate instance. This can be an API key, in which case use weaviate.classes.init.Auth.api_key(), a bearer token, in which case use weaviate.classes.init.Auth.bearer_token(), a client secret, in which case use weaviate.classes.init.Auth.client_credentials() or a username and password, in which case use weaviate.classes.init.Auth.client_password().
- Returns
- weaviate.WeaviateAsyncClient
The async client ready to connect to the cluster with the required parameters set appropriately.
- Examples:
>>> ################## Without Context Manager ############################# >>> import weaviate >>> client = weaviate.use_async_with_local( ... host="localhost", ... port=8080, ... grpc_port=50051, ... ) >>> await client.is_ready() False # The connection is not ready yet, you must call `await client.connect()` to connect. ... await client.connect() >>> await client.is_ready() True >>> await client.close() # Close the connection when you are done with it. >>> ################## With Context Manager ############################# >>> import weaviate >>> async with weaviate.use_async_with_local( ... host="localhost", ... port=8080, ... grpc_port=50051, ... ) as client: ... await client.is_ready() True >>> # The connection is automatically closed when the context is exited.
- weaviate.connect.helpers.use_async_with_weaviate_cloud(cluster_url: str, auth_credentials: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None, headers: Dict[str, str] | None = None, additional_config: AdditionalConfig | None = None, skip_init_checks: bool = False) WeaviateAsyncClient [source]
Create an async client object ready to connect to a Weaviate Cloud (WCD) instance.
This method handles creating the WeaviateAsyncClient instance with relevant options to Weaviate Cloud connections but you must manually call await client.connect(). Once you are done with the client you should call client.close() to close the connection and free up resources. Alternatively, you can use the client as a context manager in an async with statement, which will automatically open/close the connection when the context is entered/exited. See the examples below for details.
- Arguments:
- cluster_url
The WCD cluster URL or hostname to connect to. Usually in the form: rAnD0mD1g1t5.something.weaviate.cloud
- auth_credentials
The credentials to use for authentication with your Weaviate instance. This can be an API key, in which case use weaviate.classes.init.Auth.api_key(), a bearer token, in which case use weaviate.classes.init.Auth.bearer_token(), a client secret, in which case use weaviate.classes.init.Auth.client_credentials() or a username and password, in which case use weaviate.classes.init.Auth.client_password().
- headers
Additional headers to include in the requests, e.g. API keys for third-party Cloud vectorization.
- additional_config
This includes many additional, rarely used config options. use wvc.init.AdditionalConfig() to configure.
- skip_init_checks
Whether to skip the initialization checks when connecting to Weaviate.
- Returns
- weaviate.WeaviateAsyncClient
The async client ready to connect to the cluster with the required parameters set appropriately.
- Examples:
>>> ################## Without Context Manager ############################# >>> import weaviate >>> client = weaviate.use_async_with_weaviate_cloud( ... cluster_url="rAnD0mD1g1t5.something.weaviate.cloud", ... auth_credentials=weaviate.classes.init.Auth.api_key("my-api-key"), ... ) >>> await client.is_ready() False # The connection is not ready yet, you must call `await client.connect()` to connect. ... await client.connect() >>> await client.is_ready() True >>> await client.close() # Close the connection when you are done with it. >>> ################## With Context Manager ############################# >>> import weaviate >>> async with weaviate.use_async_with_weaviate_cloud( ... cluster_url="rAnD0mD1g1t5.something.weaviate.cloud", ... auth_credentials=weaviate.classes.init.Auth.api_key("my-api-key"), ... ) as client: ... await client.is_ready() True