weaviate.client
Client class definition.
- class weaviate.client.WeaviateAsyncClient(connection_params: ConnectionParams | None = None, embedded_options: EmbeddedOptions | None = None, auth_client_secret: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None = None, additional_headers: dict | None = None, additional_config: AdditionalConfig | None = None, skip_init_checks: bool = False)[source]
Bases:
_WeaviateClientExecutor[ConnectionAsync]The v4 Python-native Weaviate Client class that encapsulates Weaviate functionalities in one object.
WARNING: This client is only compatible with Weaviate v1.23.6 and higher!
A Client instance creates all the needed objects to interact with Weaviate, and connects all of them to the same Weaviate instance. See below the Attributes of the Client instance. For the per attribute functionality see that attribute’s documentation.
- Attributes:
- backup
A _BackupAsync object instance connected to the same Weaviate instance as the Client.
- cluster
A ClusterAsync object instance connected to the same Weaviate instance as the Client.
- collections
A _CollectionsAsync object instance connected to the same Weaviate instance as the Client.
- debug
A _DebugAsync object instance connected to the same Weaviate instance as the Client.
- roles
A _RolesAsync object instance connected to the same Weaviate instance as the Client.
- users
A _UsersAsync object instance connected to the same Weaviate instance as the Client.
Initialise a WeaviateClient/WeaviateClientAsync class instance to use when interacting with Weaviate.
Use this specific initializer when you want to create a custom Client specific to your Weaviate setup.
To simplify connections to Weaviate Cloud or local instances, use the weaviate.connect_to_weaviate_cloud or weaviate.connect_to_local helper functions.
- Arguments:
- connection_params: weaviate.connect.ConnectionParams or None, optional
The connection parameters to use for the underlying HTTP requests.
- embedded_options: weaviate.EmbeddedOptions or None, optional
The options to use when provisioning an embedded Weaviate instance.
- auth_client_secret: weaviate.AuthCredentials or None, optional
- Authenticate to weaviate by using one of the given authentication modes:
weaviate.auth.AuthBearerToken to use existing access and (optionally, but recommended) refresh tokens
weaviate.auth.AuthClientPassword to use username and password for oidc Resource Owner Password flow
weaviate.auth.AuthClientCredentials to use a client secret for oidc client credential flow
- additional_headers: dict or None, optional
- Additional headers to include in the requests.
Can be used to set OpenAI/HuggingFace/Cohere etc. keys.
[Here](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-openai#providing-the-key-to-weaviate) is an
example of how to set API keys within this parameter.
- additional_config: weaviate.AdditionalConfig or None, optional
Additional and advanced configuration options for Weaviate.
- skip_init_checks: bool, optional
If set to True then the client will not perform any checks including ensuring that weaviate has started. This is useful for air-gapped environments and high-performance setups.
- backup
This namespace contains all functionality to backup data.
- cluster
This namespace contains all functionality to inspect the connected Weaviate cluster.
- collections
This namespace contains all the functionality to manage Weaviate data collections. It is your main entry point for all collection-related functionality.
Use it to retrieve collection objects using client.collections.use(“MyCollection”) or to create new collections using await client.collections.create(“MyCollection”, …).
- debug
This namespace contains functionality used to debug Weaviate clusters. As such, it is deemed experimental and is subject to change.
We can make no guarantees about the stability of this namespace nor the potential for future breaking changes. Use at your own risk.
- roles
This namespace contains all functionality to manage Weaviate’s RBAC functionality.
- users
This namespace contains all functionality to manage Weaviate users.
- class weaviate.client.WeaviateClient(connection_params: ConnectionParams | None = None, embedded_options: EmbeddedOptions | None = None, auth_client_secret: _BearerToken | _ClientPassword | _ClientCredentials | _APIKey | None = None, additional_headers: dict | None = None, additional_config: AdditionalConfig | None = None, skip_init_checks: bool = False)[source]
Bases:
_WeaviateClientExecutor[ConnectionSync]The v4 Python-native Weaviate Client class that encapsulates Weaviate functionalities in one object.
WARNING: This client is only compatible with Weaviate v1.23.6 and higher!
A Client instance creates all the needed objects to interact with Weaviate, and connects all of them to the same Weaviate instance. See below the Attributes of the Client instance. For the per attribute functionality see that attribute’s documentation.
- Attributes:
- backup
A Backup object instance connected to the same Weaviate instance as the Client.
- batch
A _Batch object instance connected to the same Weaviate instance as the Client.
- classification
A Classification object instance connected to the same Weaviate instance as the Client.
- cluster
A Cluster object instance connected to the same Weaviate instance as the Client.
- collections
A _Collections object instance connected to the same Weaviate instance as the Client.
- debug
A _Debug object instance connected to the same Weaviate instance as the Client.
- roles
A _Roles object instance connected to the same Weaviate instance as the Client.
- users
A _Users object instance connected to the same Weaviate instance as the Client.
Initialise a WeaviateClient/WeaviateClientAsync class instance to use when interacting with Weaviate.
Use this specific initializer when you want to create a custom Client specific to your Weaviate setup.
To simplify connections to Weaviate Cloud or local instances, use the weaviate.connect_to_weaviate_cloud or weaviate.connect_to_local helper functions.
- Arguments:
- connection_params: weaviate.connect.ConnectionParams or None, optional
The connection parameters to use for the underlying HTTP requests.
- embedded_options: weaviate.EmbeddedOptions or None, optional
The options to use when provisioning an embedded Weaviate instance.
- auth_client_secret: weaviate.AuthCredentials or None, optional
- Authenticate to weaviate by using one of the given authentication modes:
weaviate.auth.AuthBearerToken to use existing access and (optionally, but recommended) refresh tokens
weaviate.auth.AuthClientPassword to use username and password for oidc Resource Owner Password flow
weaviate.auth.AuthClientCredentials to use a client secret for oidc client credential flow
- additional_headers: dict or None, optional
- Additional headers to include in the requests.
Can be used to set OpenAI/HuggingFace/Cohere etc. keys.
[Here](https://weaviate.io/developers/weaviate/modules/reader-generator-modules/generative-openai#providing-the-key-to-weaviate) is an
example of how to set API keys within this parameter.
- additional_config: weaviate.AdditionalConfig or None, optional
Additional and advanced configuration options for Weaviate.
- skip_init_checks: bool, optional
If set to True then the client will not perform any checks including ensuring that weaviate has started. This is useful for air-gapped environments and high-performance setups.
- backup
This namespace contains all functionality to backup data.
- batch
This namespace contains all the functionality to upload data in batches to Weaviate for all collections and tenants.
- cluster
This namespace contains all functionality to inspect the connected Weaviate cluster.
- collections
This namespace contains all the functionality to manage Weaviate data collections. It is your main entry point for all collection-related functionality.
Use it to retrieve collection objects using client.collections.use(“MyCollection”) or to create new collections using client.collections.create(“MyCollection”, …).
- debug
This namespace contains functionality used to debug Weaviate clusters. As such, it is deemed experimental and is subject to change.
We can make no guarantees about the stability of this namespace nor the potential for future breaking changes. Use at your own risk.
- roles
This namespace contains all functionality to manage Weaviate’s RBAC functionality.
- users
This namespace contains all functionality to manage Weaviate users.