weaviate.collections.collections

class weaviate.collections.collections._CollectionsAsync(connection)[source]

Bases: _CollectionsBase[ConnectionAsync]

Parameters:

connection (ConnectionType)

async create_from_config(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration object.

Parameters:

config (_CollectionConfig) – The collection’s configuration.

Raises:
Return type:

CollectionAsync

async create_from_dict(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration dictionary object.

This method is helpful for those making the v3 -> v4 migration and for those interfacing with any experimental Weaviate features that are not yet fully supported by the Weaviate Python client.

Parameters:

config (dict) – The dictionary representation of the collection’s configuration.

Raises:
Return type:

CollectionAsync

use(name, data_model_properties=None, data_model_references=None, skip_argument_validation=False)[source]

Use this method to return a collection object to be used when interacting with your Weaviate collection.

This method does not send a request to Weaviate. It simply creates a Python object for you to use to make requests.

Parameters:
  • name (str) – The name of the collection to get.

  • data_model_properties (Type[Properties] | None) – The generic class that you want to use to represent the properties of objects in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return objects properties as Dict[str, Any].

  • data_model_references (Type[References] | None) – The generic class that you want to use to represent the objects of references in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return properties of referenced objects as Dict[str, Any].

  • skip_argument_validation (bool) – If arguments to functions such as near_vector should be validated. Disable this if you need to squeeze out some extra performance.

Raises:
  • WeaviateInvalidInputError – If the input parameters are invalid.

  • InvalidDataModelException – If the data model is not a valid data model, i.e., it is not a dict nor a TypedDict.

Return type:

CollectionAsync[Properties, References]

class weaviate.collections.collections._Collections(connection)[source]

Bases: _CollectionsBase[ConnectionSync]

Parameters:

connection (ConnectionType)

create_from_config(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration object.

Parameters:

config (_CollectionConfig) – The collection’s configuration.

Raises:
Return type:

Collection

create_from_dict(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration dictionary object.

This method is helpful for those making the v3 -> v4 migration and for those interfacing with any experimental Weaviate features that are not yet fully supported by the Weaviate Python client.

Parameters:

config (dict) – The dictionary representation of the collection’s configuration.

Raises:
Return type:

Collection

use(name, data_model_properties=None, data_model_references=None, skip_argument_validation=False)[source]

Use this method to return a collection object to be used when interacting with your Weaviate collection.

This method does not send a request to Weaviate. It simply creates a Python object for you to use to make requests.

Parameters:
  • name (str) – The name of the collection to get.

  • data_model_properties (Type[Properties] | None) – The generic class that you want to use to represent the properties of objects in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return objects properties as Dict[str, Any].

  • data_model_references (Type[References] | None) – The generic class that you want to use to represent the objects of references in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return properties of referenced objects as Dict[str, Any].

  • skip_argument_validation (bool) – If arguments to functions such as near_vector should be validated. Disable this if you need to squeeze out some extra performance.

Raises:
  • WeaviateInvalidInputError – If the input parameters are invalid.

  • InvalidDataModelException – If the data model is not a valid data model, i.e., it is not a dict nor a TypedDict.

Return type:

Collection[Properties, References]

weaviate.collections.collections.async_

class weaviate.collections.collections.async_._CollectionsAsync(connection)[source]

Bases: _CollectionsBase[ConnectionAsync]

Parameters:

connection (ConnectionType)

use(name, data_model_properties=None, data_model_references=None, skip_argument_validation=False)[source]

Use this method to return a collection object to be used when interacting with your Weaviate collection.

This method does not send a request to Weaviate. It simply creates a Python object for you to use to make requests.

Parameters:
  • name (str) – The name of the collection to get.

  • data_model_properties (Type[Properties] | None) – The generic class that you want to use to represent the properties of objects in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return objects properties as Dict[str, Any].

  • data_model_references (Type[References] | None) – The generic class that you want to use to represent the objects of references in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return properties of referenced objects as Dict[str, Any].

  • skip_argument_validation (bool) – If arguments to functions such as near_vector should be validated. Disable this if you need to squeeze out some extra performance.

Raises:
  • WeaviateInvalidInputError – If the input parameters are invalid.

  • InvalidDataModelException – If the data model is not a valid data model, i.e., it is not a dict nor a TypedDict.

Return type:

CollectionAsync[Properties, References]

async create_from_dict(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration dictionary object.

This method is helpful for those making the v3 -> v4 migration and for those interfacing with any experimental Weaviate features that are not yet fully supported by the Weaviate Python client.

Parameters:

config (dict) – The dictionary representation of the collection’s configuration.

Raises:
Return type:

CollectionAsync

async create_from_config(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration object.

Parameters:

config (_CollectionConfig) – The collection’s configuration.

Raises:
Return type:

CollectionAsync

weaviate.collections.collections.base

class weaviate.collections.collections.base._CollectionsBase(connection)[source]

Bases: Generic[ConnectionType], _CollectionsExecutor[ConnectionType]

Parameters:

connection (ConnectionType)

get(name, data_model_properties=None, data_model_references=None, skip_argument_validation=False)[source]

Use this method to return a collection object to be used when interacting with your Weaviate collection.

This method does not send a request to Weaviate. It simply creates a Python object for you to use to make requests.

Parameters:
  • name (str) – The name of the collection to get.

  • data_model_properties (Type[Properties] | None) – The generic class that you want to use to represent the properties of objects in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return objects properties as Dict[str, Any].

  • data_model_references (Type[References] | None) – The generic class that you want to use to represent the objects of references in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return properties of referenced objects as Dict[str, Any].

  • skip_argument_validation (bool) – If arguments to functions such as near_vector should be validated. Disable this if you need to squeeze out some extra performance.

Raises:
  • WeaviateInvalidInputError – If the input parameters are invalid.

  • InvalidDataModelException – If the data model is not a valid data model, i.e., it is not a dict nor a TypedDict.

Return type:

Collection[Properties, References] | CollectionAsync[Properties, References]

abstractmethod use(name, data_model_properties=None, data_model_references=None, skip_argument_validation=False)[source]

Use this method to return a collection object to be used when interacting with your Weaviate collection.

This method does not send a request to Weaviate. It simply creates a Python object for you to use to make requests.

Parameters:
  • name (str) – The name of the collection to get.

  • data_model_properties (Type[Properties] | None) – The generic class that you want to use to represent the properties of objects in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return objects properties as Dict[str, Any].

  • data_model_references (Type[References] | None) – The generic class that you want to use to represent the objects of references in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return properties of referenced objects as Dict[str, Any].

  • skip_argument_validation (bool) – If arguments to functions such as near_vector should be validated. Disable this if you need to squeeze out some extra performance.

Raises:
  • WeaviateInvalidInputError – If the input parameters are invalid.

  • InvalidDataModelException – If the data model is not a valid data model, i.e., it is not a dict nor a TypedDict.

Return type:

Collection[Properties, References] | CollectionAsync[Properties, References]

abstractmethod create_from_dict(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration dictionary object.

This method is helpful for those making the v3 -> v4 migration and for those interfacing with any experimental Weaviate features that are not yet fully supported by the Weaviate Python client.

Parameters:

config (dict) – The dictionary representation of the collection’s configuration.

Raises:
Return type:

Collection[Properties, References] | Awaitable[CollectionAsync[Properties, References]]

abstractmethod create_from_config(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration object.

Parameters:

config (_CollectionConfig) – The collection’s configuration.

Raises:
Return type:

Collection[Properties, References] | Awaitable[CollectionAsync[Properties, References]]

weaviate.collections.collections.sync

class weaviate.collections.collections.sync._Collections(connection)[source]

Bases: _CollectionsBase[ConnectionSync]

Parameters:

connection (ConnectionType)

use(name, data_model_properties=None, data_model_references=None, skip_argument_validation=False)[source]

Use this method to return a collection object to be used when interacting with your Weaviate collection.

This method does not send a request to Weaviate. It simply creates a Python object for you to use to make requests.

Parameters:
  • name (str) – The name of the collection to get.

  • data_model_properties (Type[Properties] | None) – The generic class that you want to use to represent the properties of objects in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return objects properties as Dict[str, Any].

  • data_model_references (Type[References] | None) – The generic class that you want to use to represent the objects of references in this collection when mutating objects through the .query namespace. The generic provided in this argument will propagate to the methods in .query and allow you to do mypy static type checking on your codebase. If you do not provide a generic, the methods in .query will return properties of referenced objects as Dict[str, Any].

  • skip_argument_validation (bool) – If arguments to functions such as near_vector should be validated. Disable this if you need to squeeze out some extra performance.

Raises:
  • WeaviateInvalidInputError – If the input parameters are invalid.

  • InvalidDataModelException – If the data model is not a valid data model, i.e., it is not a dict nor a TypedDict.

Return type:

Collection[Properties, References]

create_from_dict(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration dictionary object.

This method is helpful for those making the v3 -> v4 migration and for those interfacing with any experimental Weaviate features that are not yet fully supported by the Weaviate Python client.

Parameters:

config (dict) – The dictionary representation of the collection’s configuration.

Raises:
Return type:

Collection

create_from_config(config)[source]

Use this method to create a collection in Weaviate and immediately return a collection object using a pre-defined Weaviate collection configuration object.

Parameters:

config (_CollectionConfig) – The collection’s configuration.

Raises:
Return type:

Collection