weaviate.classes

class weaviate.classes.ConsistencyLevel(*values)[source]

Bases: str, BaseEnum

The consistency levels when writing to Weaviate with replication enabled.

ALL

Wait for confirmation of write success from all, N, replicas.

ONE

Wait for confirmation of write success from only one replica.

QUORUM

Wait for confirmation of write success from a quorum: N/2+1, of replicas.

ALL = 'ALL'
ONE = 'ONE'
QUORUM = 'QUORUM'

weaviate.classes.aggregate

pydantic model weaviate.classes.aggregate.GroupByAggregate[source]

Bases: _WeaviateInput

Define how the aggregations’s group-by operation should be performed.

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 limit: int | None = None
field prop: str [Required]
_to_grpc()[source]
Return type:

GroupBy

_abc_impl = <_abc._abc_data object>
class weaviate.classes.aggregate.Metrics(property_)[source]

Bases: object

Define the metrics to be returned based on a property when aggregating over a collection.

Use the __init__ method to define the name to the property to be aggregated on. Then use the text, integer, number, boolean, date_, or reference methods to define the metrics to be returned.

See the docs for more details!

Parameters:

property_ (str)

boolean(count=False, percentage_false=False, percentage_true=False, total_false=False, total_true=False)[source]

Define the metrics to be returned for a BOOL or BOOL_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • percentage_false (bool) – Whether to include the percentage of objects that have a false value for this property.

  • percentage_true (bool) – Whether to include the percentage of objects that have a true value for this property.

  • total_false (bool) – Whether to include the total number of objects that have a false value for this property.

  • total_true (bool) – Whether to include the total number of objects that have a true value for this property.

Returns:

A _MetricsBoolean object that includes the metrics to be returned.

Return type:

_MetricsBoolean

date_(count=False, maximum=False, median=False, minimum=False, mode=False)[source]

Define the metrics to be returned for a DATE or DATE_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • maximum (bool) – Whether to include the maximum value of this property.

  • median (bool) – Whether to include the median value of this property.

  • minimum (bool) – Whether to include the minimum value of this property.

  • mode (bool) – Whether to include the mode value of this property.

Returns:

A _MetricsDate object that includes the metrics to be returned.

Return type:

_MetricsDate

integer(count=False, maximum=False, mean=False, median=False, minimum=False, mode=False, sum_=False)[source]

Define the metrics to be returned for an INT or INT_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • maximum (bool) – Whether to include the maximum value of this property.

  • mean (bool) – Whether to include the mean value of this property.

  • median (bool) – Whether to include the median value of this property.

  • minimum (bool) – Whether to include the minimum value of this property.

  • mode (bool) – Whether to include the mode value of this property.

  • sum – Whether to include the sum of this property.

  • sum_ (bool)

Returns:

A _MetricsInteger object that includes the metrics to be returned.

Return type:

_MetricsInteger

number(count=False, maximum=False, mean=False, median=False, minimum=False, mode=False, sum_=False)[source]

Define the metrics to be returned for a NUMBER or NUMBER_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • maximum (bool) – Whether to include the maximum value of this property.

  • mean (bool) – Whether to include the mean value of this property.

  • median (bool) – Whether to include the median value of this property.

  • minimum (bool) – Whether to include the minimum value of this property.

  • mode (bool) – Whether to include the mode value of this property.

  • sum – Whether to include the sum of this property.

  • sum_ (bool)

Returns:

A _MetricsNumber object that includes the metrics to be returned.

Return type:

_MetricsNumber

reference(pointing_to=False)[source]

Define the metrics to be returned for a cross-reference property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:

pointing_to (bool) – The UUIDs of the objects that are being pointed to.

Returns:

A _MetricsReference object that includes the metrics to be returned.

Return type:

_MetricsReference

text(count=False, top_occurrences_count=False, top_occurrences_value=False, min_occurrences=None)[source]

Define the metrics to be returned for a TEXT or TEXT_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • top_occurrences_count (bool) – Whether to include the number of the top occurrences of a property’s value.

  • top_occurrences_value (bool) – Whether to include the value of the top occurrences of a property’s value.

  • min_occurrences (int | None) – Only include entries with more occurrences than the given limit.

Returns:

A _MetricsStr object that includes the metrics to be returned.

Return type:

_MetricsText

weaviate.classes.backup

class weaviate.classes.backup.BackupCompressionLevel(*values)[source]

Bases: str, Enum

Which compression level should be used to compress the backup.

DEFAULT = 'DefaultCompression'
BEST_SPEED = 'BestSpeed'
BEST_COMPRESSION = 'BestCompression'
pydantic model weaviate.classes.backup.BackupConfigCreate[source]

Bases: _BackupConfigBase

Options to configure the backup when creating a backup.

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 CPUPercentage: int | None = None (alias 'cpu_percentage')
field ChunkSize: int | None = None (alias 'chunk_size')
field CompressionLevel: BackupCompressionLevel | None = None (alias 'compression_level')
_abc_impl = <_abc._abc_data object>
pydantic model weaviate.classes.backup.BackupConfigRestore[source]

Bases: _BackupConfigBase

Options to configure the backup when restoring a backup.

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 CPUPercentage: int | None = None (alias 'cpu_percentage')
_abc_impl = <_abc._abc_data object>
class weaviate.classes.backup.BackupStorage(*values)[source]

Bases: str, Enum

Which backend should be used to write the backup to.

FILESYSTEM = 'filesystem'
S3 = 's3'
GCS = 'gcs'
AZURE = 'azure'
class weaviate.classes.backup.BackupLocation[source]

Bases: object

The dynamic path of a backup.

Azure

alias of _BackupLocationAzure

FileSystem

alias of _BackupLocationFilesystem

GCP

alias of _BackupLocationGCP

S3

alias of _BackupLocationS3

weaviate.classes.batch

pydantic model weaviate.classes.batch.Shard[source]

Bases: BaseModel

Use this class when defining a shard whose vector indexing process will be awaited for in a sync blocking fashion.

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 collection: str [Required]
field tenant: str | None = None
_abc_impl = <_abc._abc_data object>

weaviate.classes.config

class weaviate.classes.config.Configure[source]

Bases: object

Use this factory class to generate the correct object for use when using the collections.create() method. E.g., .multi_tenancy() will return a MultiTenancyConfigCreate object to be used in the multi_tenancy_config argument.

Each class method provides options specific to the named configuration type in the function’s name. Under-the-hood data validation steps will ensure that any mis-specifications are caught before the request is sent to Weaviate.

Generative

alias of _Generative

NamedVectors

alias of _NamedVectors

Reranker

alias of _Reranker

VectorIndex

alias of _VectorIndex

Vectorizer

alias of _Vectorizer

static inverted_index(bm25_b=None, bm25_k1=None, cleanup_interval_seconds=None, index_timestamps=None, index_property_length=None, index_null_state=None, stopwords_preset=None, stopwords_additions=None, stopwords_removals=None)[source]

Create an InvertedIndexConfigCreate object to be used when defining the configuration of the keyword searching algorithm of Weaviate.

Parameters:
  • <https (See `the docs) –

    //weaviate.io/developers/weaviate/configuration/indexes#configure-the-inverted-index>`_ for details!

  • bm25_b (float | None)

  • bm25_k1 (float | None)

  • cleanup_interval_seconds (int | None)

  • index_timestamps (bool | None)

  • index_property_length (bool | None)

  • index_null_state (bool | None)

  • stopwords_preset (StopwordsPreset | None)

  • stopwords_additions (List[str] | None)

  • stopwords_removals (List[str] | None)

Return type:

_InvertedIndexConfigCreate

static multi_tenancy(enabled=True, auto_tenant_creation=None, auto_tenant_activation=None)[source]

Create a MultiTenancyConfigCreate object to be used when defining the multi-tenancy configuration of Weaviate.

Parameters:
  • enabled (bool) – Whether multi-tenancy is enabled. Defaults to True.

  • auto_tenant_creation (bool | None) – Automatically create nonexistent tenants during object creation. Defaults to None, which uses the server-defined default.

  • auto_tenant_activation (bool | None) – Automatically turn tenants implicitly HOT when they are accessed. Defaults to None, which uses the server-defined default.

Return type:

_MultiTenancyConfigCreate

static replication(factor=None, async_enabled=None, deletion_strategy=None)[source]

Create a ReplicationConfigCreate object to be used when defining the replication configuration of Weaviate.

NOTE: async_enabled is only available with WeaviateDB >=v1.26.0

Parameters:
  • factor (int | None) – The replication factor.

  • async_enabled (bool | None) – Enabled async replication.

  • deletion_strategy (ReplicationDeletionStrategy | None) – How conflicts between different nodes about deleted objects are resolved.

Return type:

_ReplicationConfigCreate

static sharding(virtual_per_physical=None, desired_count=None, actual_count=None, desired_virtual_count=None, actual_virtual_count=None)[source]

Create a ShardingConfigCreate object to be used when defining the sharding configuration of Weaviate.

NOTE: You can only use one of Sharding or Replication, not both.

See the docs for more details.

Parameters:
  • virtual_per_physical (int | None) – The number of virtual shards per physical shard.

  • desired_count (int | None) – The desired number of physical shards.

  • actual_count (int | None) – The actual number of physical shards. This is a read-only field so has no effect. It is kept for backwards compatibility but will be removed in a future release.

  • desired_virtual_count (int | None) – The desired number of virtual shards.

  • actual_virtual_count (int | None) – The actual number of virtual shards. This is a read-only field so has no effect. It is kept for backwards compatibility but will be removed in a future release.

Return type:

_ShardingConfigCreate

class weaviate.classes.config.ConsistencyLevel(*values)[source]

Bases: str, BaseEnum

The consistency levels when writing to Weaviate with replication enabled.

ALL

Wait for confirmation of write success from all, N, replicas.

ONE

Wait for confirmation of write success from only one replica.

QUORUM

Wait for confirmation of write success from a quorum: N/2+1, of replicas.

ALL = 'ALL'
ONE = 'ONE'
QUORUM = 'QUORUM'
class weaviate.classes.config.Reconfigure[source]

Bases: object

Use this factory class to generate the correct xxxConfig object for use when using the collection.update() method.

Each staticmethod provides options specific to the named configuration type in the function’s name. Under-the-hood data validation steps will ensure that any mis-specifications are caught before the request is sent to Weaviate. Only those configurations that are mutable are available in this class. If you wish to update the configuration of an immutable aspect of your collection then you will have to delete the collection and re-create it with the new configuration.

Generative

alias of _Generative

NamedVectors

alias of _NamedVectorsUpdate

Reranker

alias of _Reranker

VectorIndex

alias of _VectorIndexUpdate

static inverted_index(bm25_b=None, bm25_k1=None, cleanup_interval_seconds=None, stopwords_additions=None, stopwords_preset=None, stopwords_removals=None)[source]

Create an InvertedIndexConfigUpdate object.

Use this method when defining the inverted_index_config argument in collection.update().

Parameters:
  • <https (See `the docs) –

    //weaviate.io/developers/weaviate/configuration/indexes#configure-the-inverted-index>`_ for a more detailed view!

  • bm25_b (float | None)

  • bm25_k1 (float | None)

  • cleanup_interval_seconds (int | None)

  • stopwords_additions (List[str] | None)

  • stopwords_preset (StopwordsPreset | None)

  • stopwords_removals (List[str] | None)

Return type:

_InvertedIndexConfigUpdate

static multi_tenancy(auto_tenant_creation=None, auto_tenant_activation=None)[source]

Create a MultiTenancyConfigUpdate object.

Use this method when defining the multi_tenancy argument in collection.update().

Parameters:
  • auto_tenant_creation (bool | None) – When set, implicitly creates nonexistent tenants during object creation

  • auto_tenant_activation (bool | None) – Automatically turn tenants implicitly HOT when they are accessed. Defaults to None, which uses the server-defined default.

Return type:

_MultiTenancyConfigUpdate

static replication(factor=None, async_enabled=None, deletion_strategy=None)[source]

Create a ReplicationConfigUpdate object.

Use this method when defining the replication_config argument in collection.update().

Parameters:
  • factor (int | None) – The replication factor.

  • async_enabled (bool | None) – Enable async replication.

  • deletion_strategy (ReplicationDeletionStrategy | None) – How conflicts between different nodes about deleted objects are resolved.

Return type:

_ReplicationConfigUpdate

class weaviate.classes.config.DataType(*values)[source]

Bases: str, BaseEnum

The available primitive data types in Weaviate.

TEXT

Text data type.

TEXT_ARRAY

Text array data type.

INT

Integer data type.

INT_ARRAY

Integer array data type.

BOOL

Boolean data type.

BOOL_ARRAY

Boolean array data type.

NUMBER

Number data type.

NUMBER_ARRAY

Number array data type.

DATE

Date data type.

DATE_ARRAY

Date array data type.

UUID

UUID data type.

UUID_ARRAY

UUID array data type.

GEO_COORDINATES

Geo coordinates data type.

BLOB

Blob data type.

PHONE_NUMBER

Phone number data type.

OBJECT

Object data type.

OBJECT_ARRAY

Object array data type.

TEXT = 'text'
TEXT_ARRAY = 'text[]'
INT = 'int'
INT_ARRAY = 'int[]'
BOOL = 'boolean'
BOOL_ARRAY = 'boolean[]'
NUMBER = 'number'
NUMBER_ARRAY = 'number[]'
DATE = 'date'
DATE_ARRAY = 'date[]'
UUID = 'uuid'
UUID_ARRAY = 'uuid[]'
GEO_COORDINATES = 'geoCoordinates'
BLOB = 'blob'
PHONE_NUMBER = 'phoneNumber'
OBJECT = 'object'
OBJECT_ARRAY = 'object[]'
class weaviate.classes.config.GenerativeSearches(*values)[source]

Bases: str, BaseEnum

The available generative search modules in Weaviate.

These modules generate text from text-based inputs. See the docs for more details.

AWS

Weaviate module backed by AWS Bedrock generative models.

ANTHROPIC

Weaviate module backed by Anthropic generative models.

ANYSCALE

Weaviate module backed by Anyscale generative models.

COHERE

Weaviate module backed by Cohere generative models.

DATABRICKS

Weaviate module backed by Databricks generative models.

FRIENDLIAI

Weaviate module backed by FriendliAI generative models.

MISTRAL

Weaviate module backed by Mistral generative models.

NVIDIA

Weaviate module backed by NVIDIA generative models.

OLLAMA

Weaviate module backed by generative models deployed on Ollama infrastructure.

OPENAI

Weaviate module backed by OpenAI and Azure-OpenAI generative models.

PALM

Weaviate module backed by PaLM generative models.

AWS = 'generative-aws'
ANTHROPIC = 'generative-anthropic'
ANYSCALE = 'generative-anyscale'
COHERE = 'generative-cohere'
DATABRICKS = 'generative-databricks'
DUMMY = 'generative-dummy'
FRIENDLIAI = 'generative-friendliai'
MISTRAL = 'generative-mistral'
NVIDIA = 'generative-nvidia'
OLLAMA = 'generative-ollama'
OPENAI = 'generative-openai'
PALM = 'generative-palm'
XAI = 'generative-xai'
class weaviate.classes.config.Integrations[source]

Bases: object

static cohere(*, api_key, base_url=None, requests_per_minute_embeddings=None)[source]
Parameters:
  • api_key (str)

  • base_url (str | None)

  • requests_per_minute_embeddings (int | None)

Return type:

_IntegrationConfig

static huggingface(*, api_key, requests_per_minute_embeddings=None, base_url=None)[source]
Parameters:
  • api_key (str)

  • requests_per_minute_embeddings (int | None)

  • base_url (str | None)

Return type:

_IntegrationConfig

static jinaai(*, api_key, requests_per_minute_embeddings=None, base_url=None)[source]
Parameters:
  • api_key (str)

  • requests_per_minute_embeddings (int | None)

  • base_url (str | None)

Return type:

_IntegrationConfig

static mistral(*, api_key, request_per_minute_embeddings=None, tokens_per_minute_embeddings=None)[source]
Parameters:
  • api_key (str)

  • request_per_minute_embeddings (int | None)

  • tokens_per_minute_embeddings (int | None)

Return type:

_IntegrationConfig

static openai(*, api_key, requests_per_minute_embeddings=None, tokens_per_minute_embeddings=None, organization=None, base_url=None)[source]
Parameters:
  • api_key (str)

  • requests_per_minute_embeddings (int | None)

  • tokens_per_minute_embeddings (int | None)

  • organization (str | None)

  • base_url (str | None)

Return type:

_IntegrationConfig

static voyageai(*, api_key, requests_per_minute_embeddings=None, tokens_per_minute_embeddings=None, base_url=None)[source]
Parameters:
  • api_key (str)

  • requests_per_minute_embeddings (int | None)

  • tokens_per_minute_embeddings (int | None)

  • base_url (str | None)

Return type:

_IntegrationConfig

pydantic model weaviate.classes.config.Multi2VecField[source]

Bases: BaseModel

Use this class when defining the fields to use in the Multi2VecClip and Multi2VecBind vectorizers.

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 name: str [Required]
field weight: float | None = None
_abc_impl = <_abc._abc_data object>
class weaviate.classes.config.MultiVectorAggregation(*values)[source]

Bases: str, BaseEnum

Aggregation type to use for multivector indices.

MAX_SIM

Maximum similarity.

MAX_SIM = 'maxSim'
class weaviate.classes.config.ReplicationDeletionStrategy(*values)[source]

Bases: str, BaseEnum

How object deletions in multi node environments should be resolved.

PERMANENT_DELETION

Once an object has been deleted on one node it will be deleted on all nodes in case of conflicts.

NO_AUTOMATED_RESOLUTION

No deletion resolution.

DELETE_ON_CONFLICT = 'DeleteOnConflict'
NO_AUTOMATED_RESOLUTION = 'NoAutomatedResolution'
TIME_BASED_RESOLUTION = 'TimeBasedResolution'
pydantic model weaviate.classes.config.Property[source]

Bases: _ConfigCreateModel

This class defines the structure of a data property that a collection can have within Weaviate.

name

The name of the property, REQUIRED.

data_type

The data type of the property, REQUIRED.

description

A description of the property.

index_filterable

Whether the property should be filterable in the inverted index.

index_range_filters

Whether the property should support range filters in the inverted index.

index_searchable

Whether the property should be searchable in the inverted index.

nested_properties

nested properties for data type OBJECT and OBJECT_ARRAY`.

skip_vectorization

Whether to skip vectorization of the property. Defaults to False.

tokenization

The tokenization method to use for the inverted index. Defaults to None.

vectorize_property_name

Whether to vectorize the property name. Defaults to True.

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 dataType: DataType [Required] (alias 'data_type')
field description: str | None = None
field indexFilterable: bool | None = None (alias 'index_filterable')
field indexRangeFilters: bool | None = None (alias 'index_range_filters')
field indexSearchable: bool | None = None (alias 'index_searchable')
field name: str [Required]
Validated by:
  • _check_name

field nestedProperties: Property | List[Property] | None = None (alias 'nested_properties')
field skip_vectorization: bool = False
field tokenization: Tokenization | None = None
field vectorize_property_name: bool = True
_to_dict(vectorizers=None)[source]
Parameters:

vectorizers (Sequence[Vectorizers | _EnumLikeStr] | None)

Return type:

Dict[str, Any]

_abc_impl = <_abc._abc_data object>
class weaviate.classes.config.PQEncoderDistribution(*values)[source]

Bases: str, BaseEnum

Distribution of the PQ encoder.

LOG_NORMAL

Log-normal distribution.

NORMAL

Normal distribution.

LOG_NORMAL = 'log-normal'
NORMAL = 'normal'
class weaviate.classes.config.PQEncoderType(*values)[source]

Bases: str, BaseEnum

Type of the PQ encoder.

KMEANS

K-means encoder.

TILE

Tile encoder.

KMEANS = 'kmeans'
TILE = 'tile'
pydantic model weaviate.classes.config.ReferenceProperty[source]

Bases: _ReferencePropertyBase

This class defines properties that are cross references to a single target collection.

Use this class when you want to create a cross-reference in the collection’s config that is capable of having only cross-references to a single other collection.

name

The name of the property, REQUIRED.

target_collection

The name of the target collection, REQUIRED.

description

A description of the property.

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 description: str | None = None
field target_collection: str [Required]
MultiTarget

alias of _ReferencePropertyMultiTarget

_to_dict()[source]
Return type:

Dict[str, Any]

_abc_impl = <_abc._abc_data object>
class weaviate.classes.config.Rerankers(*values)[source]

Bases: str, BaseEnum

The available reranker modules in Weaviate.

These modules rerank the results of a search query. See the docs for more details.

NONE

No reranker.

COHERE

Weaviate module backed by Cohere reranking models.

TRANSFORMERS

Weaviate module backed by Transformers reranking models.

VOYAGEAI

Weaviate module backed by VoyageAI reranking models.

JINAAI

Weaviate module backed by JinaAI reranking models.

NVIDIA

Weaviate module backed by NVIDIA reranking models.

NONE = 'none'
COHERE = 'reranker-cohere'
TRANSFORMERS = 'reranker-transformers'
VOYAGEAI = 'reranker-voyageai'
JINAAI = 'reranker-jinaai'
NVIDIA = 'reranker-nvidia'
class weaviate.classes.config.StopwordsPreset(*values)[source]

Bases: str, BaseEnum

Preset stopwords to use in the Stopwords class.

EN

English stopwords.

NONE

No stopwords.

NONE = 'none'
EN = 'en'
class weaviate.classes.config.Tokenization(*values)[source]

Bases: str, BaseEnum

The available inverted index tokenization methods for text properties in Weaviate.

WORD

Tokenize by word.

WHITESPACE

Tokenize by whitespace.

LOWERCASE

Tokenize by lowercase.

FIELD

Tokenize by field.

GSE

Tokenize using GSE (for Chinese and Japanese).

TRIGRAM

Tokenize into trigrams.

KAGOME_JA

Tokenize using the ‘Kagome’ tokenizer (for Japanese).

KAGOME_KR

Tokenize using the ‘Kagome’ tokenizer and a Korean MeCab dictionary (for Korean).

WORD = 'word'
WHITESPACE = 'whitespace'
LOWERCASE = 'lowercase'
FIELD = 'field'
GSE = 'gse'
TRIGRAM = 'trigram'
KAGOME_JA = 'kagome_ja'
KAGOME_KR = 'kagome_kr'
class weaviate.classes.config.Vectorizers(*values)[source]

Bases: str, Enum

The available vectorization modules in Weaviate.

These modules encode binary data into lists of floats called vectors. See the docs for more details.

NONE

No vectorizer.

TEXT2VEC_AWS

Weaviate module backed by AWS text-based embedding models.

TEXT2VEC_COHERE

Weaviate module backed by Cohere text-based embedding models.

TEXT2VEC_CONTEXTIONARY

Weaviate module backed by Contextionary text-based embedding models.

TEXT2VEC_GPT4ALL

Weaviate module backed by GPT-4-All text-based embedding models.

TEXT2VEC_HUGGINGFACE

Weaviate module backed by HuggingFace text-based embedding models.

TEXT2VEC_OPENAI

Weaviate module backed by OpenAI and Azure-OpenAI text-based embedding models.

TEXT2VEC_PALM

Weaviate module backed by PaLM text-based embedding models.

TEXT2VEC_TRANSFORMERS

Weaviate module backed by Transformers text-based embedding models.

TEXT2VEC_JINAAI

Weaviate module backed by Jina AI text-based embedding models.

TEXT2VEC_VOYAGEAI

Weaviate module backed by Voyage AI text-based embedding models.

TEXT2VEC_NVIDIA

Weaviate module backed by NVIDIA text-based embedding models.

TEXT2VEC_WEAVIATE

Weaviate module backed by Weaviate’s self-hosted text-based embedding models.

IMG2VEC_NEURAL

Weaviate module backed by a ResNet-50 neural network for images.

MULTI2VEC_CLIP

Weaviate module backed by a Sentence-BERT CLIP model for images and text.

MULTI2VEC_PALM

Weaviate module backed by a palm model for images and text.

MULTI2VEC_BIND

Weaviate module backed by the ImageBind model for images, text, audio, depth, IMU, thermal, and video.

MULTI2VEC_VOYAGEAI

Weaviate module backed by a Voyage AI multimodal embedding models.

MULTI2VEC_NVIDIA

Weaviate module backed by NVIDIA multimodal embedding models.

REF2VEC_CENTROID

Weaviate module backed by a centroid-based model that calculates an object’s vectors from its referenced vectors.

NONE = 'none'
TEXT2COLBERT_JINAAI = 'text2colbert-jinaai'
TEXT2VEC_AWS = 'text2vec-aws'
TEXT2VEC_COHERE = 'text2vec-cohere'
TEXT2VEC_CONTEXTIONARY = 'text2vec-contextionary'
TEXT2VEC_DATABRICKS = 'text2vec-databricks'
TEXT2VEC_GPT4ALL = 'text2vec-gpt4all'
TEXT2VEC_HUGGINGFACE = 'text2vec-huggingface'
TEXT2VEC_MISTRAL = 'text2vec-mistral'
TEXT2VEC_NVIDIA = 'text2vec-nvidia'
TEXT2VEC_OLLAMA = 'text2vec-ollama'
TEXT2VEC_OPENAI = 'text2vec-openai'
TEXT2VEC_PALM = 'text2vec-palm'
TEXT2VEC_TRANSFORMERS = 'text2vec-transformers'
TEXT2VEC_JINAAI = 'text2vec-jinaai'
TEXT2VEC_VOYAGEAI = 'text2vec-voyageai'
TEXT2VEC_WEAVIATE = 'text2vec-weaviate'
IMG2VEC_NEURAL = 'img2vec-neural'
MULTI2VEC_CLIP = 'multi2vec-clip'
MULTI2VEC_COHERE = 'multi2vec-cohere'
MULTI2VEC_JINAAI = 'multi2vec-jinaai'
MULTI2VEC_BIND = 'multi2vec-bind'
MULTI2VEC_PALM = 'multi2vec-palm'
MULTI2VEC_VOYAGEAI = 'multi2vec-voyageai'
MULTI2VEC_NVIDIA = 'multi2vec-nvidia'
REF2VEC_CENTROID = 'ref2vec-centroid'
class weaviate.classes.config.VectorDistances(*values)[source]

Bases: str, Enum

Vector similarity distance metric to be used in the VectorIndexConfig class.

To ensure optimal search results, we recommend reviewing whether your model provider advises a specific distance metric and following their advice.

COSINE

Cosine distance: reference

DOT

Dot distance: reference

L2_SQUARED

L2 squared distance: reference

HAMMING

Hamming distance: reference

MANHATTAN

Manhattan distance: reference

COSINE = 'cosine'
DOT = 'dot'
L2_SQUARED = 'l2-squared'
HAMMING = 'hamming'
MANHATTAN = 'manhattan'
class weaviate.classes.config.VectorFilterStrategy(*values)[source]

Bases: str, Enum

Set the strategy when doing a filtered HNSW search.

SWEEPING

Do normal ANN search and skip nodes.

ACORN

Multi-hop search to find new candidates matching the filter.

SWEEPING = 'sweeping'
ACORN = 'acorn'

weaviate.classes.data

class weaviate.classes.data.DataObject(properties=None, uuid=None, vector=None, references=None)[source]

Bases: Generic[P, R]

This class represents an entire object within a collection to be used when batching.

Parameters:
  • properties (P)

  • uuid (str | UUID | None)

  • vector (Mapping[str, Sequence[int | float] | Sequence[Sequence[int | float]]] | Sequence[int | float] | None)

  • references (R)

properties: P = None
references: R = None
uuid: str | UUID | None = None
vector: Mapping[str, Sequence[int | float] | Sequence[Sequence[int | float]]] | Sequence[int | float] | None = None
class weaviate.classes.data.DataReference(from_property, from_uuid, to_uuid)[source]

Bases: _DataReference

This class represents a reference between objects within a collection to be used when batching.

Parameters:
  • from_property (str)

  • from_uuid (str | UUID)

  • to_uuid (str | UUID | List[str | UUID])

MultiTarget

alias of DataReferenceMulti

_to_beacons()[source]
Return type:

List[str]

pydantic model weaviate.classes.data.GeoCoordinate[source]

Bases: _WeaviateInput

Input for the geo-coordinate datatype.

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 latitude: float [Required]
Constraints:
  • ge = -90

  • le = 90

field longitude: float [Required]
Constraints:
  • ge = -180

  • le = 180

_to_dict()[source]
Return type:

Dict[str, float]

_abc_impl = <_abc._abc_data object>
pydantic model weaviate.classes.data.PhoneNumber[source]

Bases: _PhoneNumberBase

Input for the phone number datatype.

default_country should correspond to the ISO 3166-1 alpha-2 country code. This is used to figure out the correct countryCode and international format if only a national number (e.g. 0123 4567) is provided.

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 default_country: str | None = None
_to_dict()[source]
Return type:

Mapping[str, str]

_abc_impl = <_abc._abc_data object>

weaviate.classes.debug

pydantic model weaviate.classes.debug.DebugRESTObject[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 collection: str [Required] (alias 'class')
field creation_time: datetime [Required] (alias 'creationTimeUnix')
field last_update_time: datetime [Required] (alias 'lastUpdateTimeUnix')
field properties: Dict[str, Any] [Required]
field tenant: str | None = None
field uuid: UUID [Required] (alias 'id')
field vector: list[float] | None = None
field vectors: Dict[str, list[float]] | None = None
_abc_impl = <_abc._abc_data object>

weaviate.classes.generics

class weaviate.classes.generics.CrossReferenceAnnotation(include_vector=False, metadata=None, target_collection=None)[source]

Bases: object

Dataclass to be used when annotating a generic cross reference property with options for retrieving data from the cross referenced object when querying.

Example

>>> import typing
>>> import weaviate.classes as wvc
>>>
>>> class One(typing.TypedDict):
...     prop: str
>>>
>>> class Two(typing.TypedDict):
...     one: typing.Annotated[
...         wvc.CrossReference[One],
...         wvc.CrossReferenceAnnotation(include_vector=True)
...     ]
Parameters:
  • include_vector (bool)

  • metadata (MetadataQuery | None)

  • target_collection (str | None)

include_vector: bool = False
metadata: MetadataQuery | None = None
target_collection: str | None = None

weaviate.classes.init

class weaviate.classes.init.Auth[source]

Bases: object

static api_key(api_key)[source]
Parameters:

api_key (str)

Return type:

_APIKey

static bearer_token(access_token, expires_in=60, refresh_token=None)[source]
Parameters:
  • access_token (str)

  • expires_in (int)

  • refresh_token (str | None)

Return type:

_BearerToken

static client_credentials(client_secret, scope=None)[source]
Parameters:
  • client_secret (str)

  • scope (str | List[str] | None)

Return type:

_ClientCredentials

static client_password(username, password, scope=None)[source]
Parameters:
  • username (str)

  • password (str)

  • scope (str | List[str] | None)

Return type:

_ClientPassword

pydantic model weaviate.classes.init.AdditionalConfig[source]

Bases: BaseModel

Use this class to specify the connection and proxy settings for your client when connecting to Weaviate.

When specifying the timeout, you can either provide a tuple with the query and insert timeouts, or a Timeout object. The Timeout object gives you additional option to configure the init timeout, which controls how long the client initialisation checks will wait for before throwing. This is useful when you have a slow network connection.

When specifying the proxies, be aware that supplying a URL (str) will populate all of the http, https, and grpc proxies. In order for this to be possible, you must have a proxy that is capable of handling simultaneous HTTP/1.1 and HTTP/2 traffic.

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 connection: ConnectionConfig [Optional]
field proxies: str | Proxies | None = None
field timeout_: Tuple[int, int] | Timeout [Optional] (alias 'timeout')
field trust_env: bool = False
_abc_impl = <_abc._abc_data object>
property timeout: Timeout
pydantic model weaviate.classes.init.Proxies[source]

Bases: BaseModel

Proxy configurations for sending requests to Weaviate through a proxy.

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: str | None = None
field http: str | None = None
field https: str | None = None
_abc_impl = <_abc._abc_data object>
pydantic model weaviate.classes.init.Timeout[source]

Bases: BaseModel

Timeouts for the different operations in the client.

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 init: int | float = 2
Constraints:
  • ge = 0

field insert: int | float = 90
Constraints:
  • ge = 0

field query: int | float = 30
Constraints:
  • ge = 0

_abc_impl = <_abc._abc_data object>

weaviate.classes.query

class weaviate.classes.query.Filter[source]

Bases: object

This class is used to define filters to be used when querying and deleting from a collection.

It forms the root of a method chaining hierarchy that allows you to iteratively define filters that can hop between objects through references in a formulaic way.

See the docs for more information.

static all_of(filters)[source]

Combine all filters in the input list with an AND operator.

Parameters:

filters (List[_Filters])

Return type:

_Filters

static any_of(filters)[source]

Combine all filters in the input list with an OR operator.

Parameters:

filters (List[_Filters])

Return type:

_Filters

static by_creation_time()[source]

Define a filter based on the creation time to be used when querying and deleting from a collection.

Return type:

_FilterByCreationTime

static by_id()[source]

Define a filter based on the uuid to be used when querying and deleting from a collection.

Return type:

_FilterById

static by_property(name, length=False)[source]

Define a filter based on a property to be used when querying and deleting from a collection.

Parameters:
  • name (str)

  • length (bool)

Return type:

_FilterByProperty

static by_ref(link_on)[source]

Define a filter based on a reference to be used when querying and deleting from a collection.

Parameters:

link_on (str)

Return type:

_FilterByRef

static by_ref_count(link_on)[source]

Define a filter based on the number of references to be used when querying and deleting from a collection.

Parameters:

link_on (str)

Return type:

_FilterByCount

static by_ref_multi_target(link_on, target_collection)[source]

Define a filter based on a reference to be used when querying and deleting from a collection.

Parameters:
  • link_on (str)

  • target_collection (str)

Return type:

_FilterByRef

static by_update_time()[source]

Define a filter based on the update time to be used when querying and deleting from a collection.

Return type:

_FilterByUpdateTime

pydantic model weaviate.classes.query.GeoCoordinate[source]

Bases: _WeaviateInput

Input for the geo-coordinate datatype.

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 latitude: float [Required]
Constraints:
  • ge = -90

  • le = 90

field longitude: float [Required]
Constraints:
  • ge = -180

  • le = 180

_to_dict()[source]
Return type:

Dict[str, float]

_abc_impl = <_abc._abc_data object>
class weaviate.classes.query.GenerativeConfig[source]

Bases: object

Use this factory class to create the correct object for the generative_provider argument in the search methods of the .generate namespace.

Each staticmethod provides options specific to the named generative search module in the function’s name. Under-the-hood data validation steps will ensure that any mis-specifications will be caught before the request is sent to Weaviate.

static anthropic(*, base_url=None, model=None, max_tokens=None, stop_sequences=None, temperature=None, top_k=None, top_p=None)[source]

Create a _GenerativeAnthropic object for use when performing dynamic AI generation using the generative-anthropic module.

Parameters:
  • base_url (str | None) – The base URL to send the API request to. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • stop_sequences (List[str] | None) – The stop sequences to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_k (int | None) – The top K to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static anyscale(*, base_url=None, model=None, temperature=None)[source]

Create a _GenerativeAnyscale object for use when performing dynamic AI generation using the generative-anyscale module.

Parameters:
  • base_url (str | None) – The base URL to send the API request to. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static aws(*, endpoint=None, model=None, region=None, service=None, target_model=None, target_variant=None, temperature=None)[source]

Create a _GenerativeAWS object for use when performing dynamic AI generation using the generative-aws module.

See the documentation for detailed usage.

Parameters:
  • endpoint (str | None) – The endpoint to use when requesting the generation. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • region (str | None) – The AWS region to run the model from. Defaults to None, which uses the server-defined default

  • service (Literal['bedrock', 'sagemaker'] | str | None) – The AWS service to use. Defaults to None, which uses the server-defined default

  • target_model (str | None) – The target model to use. Defaults to None, which uses the server-defined default

  • target_variant (str | None) – The target variant to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static azure_openai(*, api_version=None, base_url=None, deployment_id=None, frequency_penalty=None, max_tokens=None, model=None, presence_penalty=None, resource_name=None, stop=None, temperature=None, top_p=None)[source]

Create a _GenerativeOpenAI object for use when performing AI generation using the Azure-backed generative-openai module.

See the documentation for detailed usage.

Parameters:
  • api_version (str | None) – The API version to use. Defaults to None, which uses the server-defined default

  • base_url (str | None) – The base URL where the API request should go. Defaults to None, which uses the server-defined default

  • deployment_id (str | None) – The deployment ID to use. Defaults to None, which uses the server-defined default

  • frequency_penalty (float | None) – The frequency penalty to use. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • presence_penalty (float | None) – The presence penalty to use. Defaults to None, which uses the server-defined default

  • resource_name (str | None) – The name of the OpenAI resource to use. Defaults to None, which uses the server-defined default

  • stop (List[str] | None) – The stop sequences to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static cohere(*, base_url=None, k=None, max_tokens=None, model=None, p=None, presence_penalty=None, stop_sequences=None, temperature=None)[source]

Create a _GenerativeCohere object for use when performing AI generation using the generative-cohere module.

See the documentation for detailed usage.

Parameters:
  • base_url (str | None) – The base URL where the API request should go. Defaults to None, which uses the server-defined default

  • k (int | None) – The top K property to use. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • p (float | None) – The top P property to use. Defaults to None, which uses the server-defined default

  • presence_penalty (float | None) – The presence penalty to use. Defaults to None, which uses the server-defined default

  • stop_sequences (List[str] | None) – The stop sequences to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static databricks(*, endpoint, frequency_penalty=None, log_probs=None, max_tokens=None, model=None, n=None, presence_penalty=None, stop=None, temperature=None, top_log_probs=None, top_p=None)[source]

Create a _GenerativeDatabricks object for use when performing AI generation using the generative-databricks module.

Parameters:
  • endpoint (str) – The URL where the API request should go. Defaults to None, which uses the server-defined default

  • frequency_penalty (float | None) – The frequency penalty to use. Defaults to None, which uses the server-defined default

  • log_probs (bool | None) – Whether to log probabilities. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • n (int | None) – The number of sequences to generate. Defaults to None, which uses the server-defined default

  • presence_penalty (float | None) – The presence penalty to use. Defaults to None, which uses the server-defined default

  • stop (List[str] | None) – The stop sequences to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_log_probs (int | None) – The top log probabilities to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P value to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static dummy()[source]

Create a _GenerativeDummy object for use when performing AI generation using the generative-dummy module.

Return type:

_GenerativeConfigRuntime

static friendliai(*, base_url=None, max_tokens=None, model=None, n=None, temperature=None, top_p=None)[source]

Create a _GenerativeFriendliai object for use when performing AI generation using the generative-friendliai module.

Parameters:
  • base_url (str | None) – The base URL where the API request should go. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • n (int | None) – The number of sequences to generate. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P value to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static google(*, api_endpoint=None, endpoint_id=None, frequency_penalty=None, max_tokens=None, model=None, presence_penalty=None, project_id=None, region=None, stop_sequences=None, temperature=None, top_k=None, top_p=None)[source]

Create a _GenerativeGoogle object for use when performing AI generation using the generative-google module.

See the documentation for detailed usage.

Parameters:
  • api_endpoint (str | None) – The API endpoint to use. Defaults to None, which uses the server-defined default

  • endpoint_id (str | None) – The endpoint ID to use. Defaults to None, which uses the server-defined default

  • frequency_penalty (float | None) – The frequency penalty to use. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model ID to use. Defaults to None, which uses the server-defined default

  • presence_penalty (float | None) – The presence penalty to use. Defaults to None, which uses the server-defined default

  • project_id (str | None) – The project ID to use. Defaults to None, which uses the server-defined default

  • region (str | None) – The region to use. Defaults to None, which uses the server-defined default

  • stop_sequences (List[str] | None) – The stop sequences to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_k (int | None) – The top K to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static mistral(*, base_url=None, max_tokens=None, model=None, temperature=None, top_p=None)[source]

Create a _GenerativeMistral object for use when performing AI generation using the generative-mistral module.

Parameters:
  • base_url (str | None) – The base URL where the API request should go. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P value to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static nvidia(*, base_url=None, max_tokens=None, model=None, temperature=None, top_p=None)[source]

Create a _GenerativeNvidia object for use when performing AI generation using the generative-nvidia module.

Parameters:
  • base_url (str | None) – The base URL where the API request should go. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P value to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static ollama(*, api_endpoint=None, model=None, temperature=None)[source]

Create a _GenerativeOllama object for use when performing AI generation using the generative-ollama module.

Parameters:
  • api_endpoint (str | None) – The API endpoint to use. Defaults to None, which uses the server-defined default Docker users may need to specify an alias, such as http://host.docker.internal:11434 so that the container can access the host machine.

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • images – Any query-specific external images to use in the generation. Passing a string will assume a path to the image file and, if not found, will be treated as a base64-encoded string. The number of images passed to the prompt will match the length of this field.

  • grouped_task_image_properties – Any internal image properties to use in the generation sourced from the object’s properties returned by the retrieval step. The number of images passed to the prompt will match the value of limit in the search query.

Return type:

_GenerativeConfigRuntime

static openai(*, api_version=None, base_url=None, deployment_id=None, frequency_penalty=None, max_tokens=None, model=None, presence_penalty=None, resource_name=None, stop=None, temperature=None, top_p=None)[source]

Create a _GenerativeOpenAI object for use when performing AI generation using the OpenAI-backed generative-openai module.

See the documentation for detailed usage.

Parameters:
  • api_version (str | None) – The API version to use. Defaults to None, which uses the server-defined default

  • base_url (str | None) – The base URL where the API request should go. Defaults to None, which uses the server-defined default

  • deployment_id (str | None) – The deployment ID to use. Defaults to None, which uses the server-defined default

  • frequency_penalty (float | None) – The frequency penalty to use. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • presence_penalty (float | None) – The presence penalty to use. Defaults to None, which uses the server-defined default

  • resource_name (str | None) – The name of the OpenAI resource to use. Defaults to None, which uses the server-defined default

  • stop (List[str] | None) – The stop sequences to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

static xai(*, base_url=None, max_tokens=None, model=None, temperature=None, top_p=None)[source]

Create a _GenerativeXAI object for use when performing AI generation using the generative-xai module.

See the documentation for detailed usage.

Parameters:
  • base_url (str | None) – The base URL where the API request should go. Defaults to None, which uses the server-defined default

  • max_tokens (int | None) – The maximum number of tokens to generate. Defaults to None, which uses the server-defined default

  • model (str | None) – The model to use. Defaults to None, which uses the server-defined default

  • temperature (float | None) – The temperature to use. Defaults to None, which uses the server-defined default

  • top_p (float | None) – The top P to use. Defaults to None, which uses the server-defined default

Return type:

_GenerativeConfigRuntime

pydantic model weaviate.classes.query.GroupBy[source]

Bases: _WeaviateInput

Define how the query’s group-by operation should be performed.

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 number_of_groups: int [Required]
field objects_per_group: int [Required]
field prop: str [Required]
_abc_impl = <_abc._abc_data object>
class weaviate.classes.query.HybridFusion(*values)[source]

Bases: str, BaseEnum

Define how the query’s hybrid fusion operation should be performed.

RANKED = 'FUSION_TYPE_RANKED'
RELATIVE_SCORE = 'FUSION_TYPE_RELATIVE_SCORE'
class weaviate.classes.query.HybridVector[source]

Bases: object

Use this factory class to define the appropriate classes needed when defining near text and near vector sub-searches in hybrid queries.

static near_text(query, *, certainty=None, distance=None, move_to=None, move_away=None)[source]

Define a near text search to be used within a hybrid query.

Parameters:
  • query (str | List[str]) – The text to search for as a string or a list of strings.

  • certainty (float | None) – The minimum similarity score to return. If not specified, the default certainty specified by the server is used.

  • distance (float | None) – The maximum distance to search. If not specified, the default distance specified by the server is used.

  • move_to (Move | None) – Define the concepts that should be moved towards in the vector space during the search.

  • move_away (Move | None) – Define the concepts that should be moved away from in the vector space during the search.

Returns:

A _HybridNearText object to be used in the vector parameter of the query.hybrid and generate.hybrid search methods.

Return type:

_HybridNearText

static near_vector(vector, *, certainty=None, distance=None)[source]

Define a near vector search to be used within a hybrid query.

Parameters:
  • certainty (float | None) – The minimum similarity score to return. If not specified, the default certainty specified by the server is used.

  • distance (float | None) – The maximum distance to search. If not specified, the default distance specified by the server is used.

  • vector (Sequence[int | float] | Sequence[Sequence[int | float]] | Mapping[str, Sequence[int | float] | Sequence[Sequence[int | float]] | _ListOfVectorsQuery[Sequence[Union[int, float]]] | _ListOfVectorsQuery[Sequence[Sequence[Union[int, float]]]]])

Returns:

A _HybridNearVector object to be used in the vector parameter of the query.hybrid and generate.hybrid search methods.

Return type:

_HybridNearVector

weaviate.classes.query.BM25Operator

alias of BM25OperatorFactory

pydantic model weaviate.classes.query.MetadataQuery[source]

Bases: _WeaviateInput

Define which metadata should be returned in the query’s results.

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 certainty: bool = False
field creation_time: bool = False
field distance: bool = False
field explain_score: bool = False
field is_consistent: bool = False
field last_update_time: bool = False
field score: bool = False
classmethod full()[source]

Return a MetadataQuery with all fields set to True.

Return type:

MetadataQuery

_abc_impl = <_abc._abc_data object>
class weaviate.classes.query.Metrics(property_)[source]

Bases: object

Define the metrics to be returned based on a property when aggregating over a collection.

Use the __init__ method to define the name to the property to be aggregated on. Then use the text, integer, number, boolean, date_, or reference methods to define the metrics to be returned.

See the docs for more details!

Parameters:

property_ (str)

boolean(count=False, percentage_false=False, percentage_true=False, total_false=False, total_true=False)[source]

Define the metrics to be returned for a BOOL or BOOL_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • percentage_false (bool) – Whether to include the percentage of objects that have a false value for this property.

  • percentage_true (bool) – Whether to include the percentage of objects that have a true value for this property.

  • total_false (bool) – Whether to include the total number of objects that have a false value for this property.

  • total_true (bool) – Whether to include the total number of objects that have a true value for this property.

Returns:

A _MetricsBoolean object that includes the metrics to be returned.

Return type:

_MetricsBoolean

date_(count=False, maximum=False, median=False, minimum=False, mode=False)[source]

Define the metrics to be returned for a DATE or DATE_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • maximum (bool) – Whether to include the maximum value of this property.

  • median (bool) – Whether to include the median value of this property.

  • minimum (bool) – Whether to include the minimum value of this property.

  • mode (bool) – Whether to include the mode value of this property.

Returns:

A _MetricsDate object that includes the metrics to be returned.

Return type:

_MetricsDate

integer(count=False, maximum=False, mean=False, median=False, minimum=False, mode=False, sum_=False)[source]

Define the metrics to be returned for an INT or INT_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • maximum (bool) – Whether to include the maximum value of this property.

  • mean (bool) – Whether to include the mean value of this property.

  • median (bool) – Whether to include the median value of this property.

  • minimum (bool) – Whether to include the minimum value of this property.

  • mode (bool) – Whether to include the mode value of this property.

  • sum – Whether to include the sum of this property.

  • sum_ (bool)

Returns:

A _MetricsInteger object that includes the metrics to be returned.

Return type:

_MetricsInteger

number(count=False, maximum=False, mean=False, median=False, minimum=False, mode=False, sum_=False)[source]

Define the metrics to be returned for a NUMBER or NUMBER_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • maximum (bool) – Whether to include the maximum value of this property.

  • mean (bool) – Whether to include the mean value of this property.

  • median (bool) – Whether to include the median value of this property.

  • minimum (bool) – Whether to include the minimum value of this property.

  • mode (bool) – Whether to include the mode value of this property.

  • sum – Whether to include the sum of this property.

  • sum_ (bool)

Returns:

A _MetricsNumber object that includes the metrics to be returned.

Return type:

_MetricsNumber

reference(pointing_to=False)[source]

Define the metrics to be returned for a cross-reference property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:

pointing_to (bool) – The UUIDs of the objects that are being pointed to.

Returns:

A _MetricsReference object that includes the metrics to be returned.

Return type:

_MetricsReference

text(count=False, top_occurrences_count=False, top_occurrences_value=False, min_occurrences=None)[source]

Define the metrics to be returned for a TEXT or TEXT_ARRAY property when aggregating over a collection.

If none of the arguments are provided then all metrics will be returned.

Parameters:
  • count (bool) – Whether to include the number of objects that contain this property.

  • top_occurrences_count (bool) – Whether to include the number of the top occurrences of a property’s value.

  • top_occurrences_value (bool) – Whether to include the value of the top occurrences of a property’s value.

  • min_occurrences (int | None) – Only include entries with more occurrences than the given limit.

Returns:

A _MetricsStr object that includes the metrics to be returned.

Return type:

_MetricsText

class weaviate.classes.query.Move(force, objects=None, concepts=None)[source]

Bases: object

Define how the query’s move operation should be performed.

Parameters:
  • force (float)

  • objects (List[str | UUID] | str | UUID | None)

  • concepts (List[str] | str | None)

property _concepts_list: List[str] | None
property _objects_list: List[str] | None
_to_gql_payload()[source]
Return type:

dict

class weaviate.classes.query.NearMediaType(*values)[source]

Bases: str, Enum

The different types of media that can be used in a near_media query to leverage the multi2vec-* modules.

All are available when using multi2vec-bind but only IMAGE is available when using multi2vec-clip.

AUDIO = 'audio'
DEPTH = 'depth'
IMAGE = 'image'
IMU = 'imu'
THERMAL = 'thermal'
VIDEO = 'video'
pydantic model weaviate.classes.query.QueryNested[source]

Bases: _WeaviateInput

Define the query-time return properties of a nested property.

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 name: str [Required]
field properties: PROPERTIES [Required]
_abc_impl = <_abc._abc_data object>
pydantic model weaviate.classes.query.QueryReference[source]

Bases: _QueryReference

Define a query-time reference to a single-target property when querying through cross-references.

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.

MultiTarget

alias of _QueryReferenceMultiTarget

_abc_impl = <_abc._abc_data object>
class weaviate.classes.query.NearVector[source]

Bases: object

Factory class to use when defining near vector queries with multiple vectors in near_vector() and hybrid() methods.

static list_of_vectors(*vectors)[source]

Define a many-vectors query to be used within a near vector search, i.e. multiple vectors over a single-vector space.

Parameters:

vectors (V)

Return type:

_ListOfVectorsQuery

pydantic model weaviate.classes.query.Rerank[source]

Bases: _WeaviateInput

Define how the query’s rerank operation should be performed.

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 prop: str [Required]
field query: str | None = None
_abc_impl = <_abc._abc_data object>
class weaviate.classes.query.Sort[source]

Bases: object

Define how the query’s sort operation should be performed using the available static methods.

static by_creation_time(ascending=True)[source]

Sort by an object’s creation time.

Parameters:

ascending (bool)

Return type:

_Sorting

static by_id(ascending=True)[source]

Sort by an object’s ID in the collection.

Parameters:

ascending (bool)

Return type:

_Sorting

static by_property(name, ascending=True)[source]

Sort by an object property in the collection.

Parameters:
  • name (str)

  • ascending (bool)

Return type:

_Sorting

static by_update_time(ascending=True)[source]

Sort by an object’s last update time.

Parameters:

ascending (bool)

Return type:

_Sorting

class weaviate.classes.query.TargetVectors[source]

Bases: object

Define how the distances from different target vectors should be combined using the available methods.

static average(target_vectors)[source]

Combine the distance from different target vectors by averaging them.

Parameters:

target_vectors (List[str])

Return type:

_MultiTargetVectorJoin

static manual_weights(weights)[source]

Combine the distance from different target vectors by summing them using manual weights.

Parameters:

weights (Dict[str, float | List[float]])

Return type:

_MultiTargetVectorJoin

static minimum(target_vectors)[source]

Combine the distance from different target vectors by using the minimum distance.

Parameters:

target_vectors (List[str])

Return type:

_MultiTargetVectorJoin

static relative_score(weights)[source]

Combine the distance from different target vectors using score fusion.

Parameters:

weights (Dict[str, float | List[float]])

Return type:

_MultiTargetVectorJoin

static sum(target_vectors)[source]

Combine the distance from different target vectors by summing them.

Parameters:

target_vectors (List[str])

Return type:

_MultiTargetVectorJoin

weaviate.classes.rbac

class weaviate.classes.rbac.Actions[source]

Bases: object

Backups

alias of BackupsAction

Cluster

alias of ClusterAction

Collections

alias of CollectionsAction

Data

alias of DataAction

Nodes

alias of NodesAction

Roles

alias of RolesAction

Tenants

alias of TenantsAction

Users

alias of UsersAction

class weaviate.classes.rbac.Permissions[source]

Bases: object

Nodes

alias of NodesPermissions

static backup(*, collection, manage=False)[source]
Parameters:
  • collection (str | Sequence[str])

  • manage (bool)

Return type:

List[_Permission]

static cluster(*, read=False)[source]
Parameters:

read (bool)

Return type:

List[_Permission]

static collections(*, collection, create_collection=False, read_config=False, update_config=False, delete_collection=False)[source]
Parameters:
  • collection (str | Sequence[str])

  • create_collection (bool)

  • read_config (bool)

  • update_config (bool)

  • delete_collection (bool)

Return type:

List[_Permission]

static data(*, collection, tenant=None, create=False, read=False, update=False, delete=False)[source]
Parameters:
  • collection (str | Sequence[str])

  • tenant (str | Sequence[str] | None)

  • create (bool)

  • read (bool)

  • update (bool)

  • delete (bool)

Return type:

List[_Permission]

static roles(*, role, create=False, read=False, update=False, delete=False, scope=None)[source]
Parameters:
  • role (str | Sequence[str])

  • create (bool)

  • read (bool)

  • update (bool)

  • delete (bool)

  • scope (RoleScope | None)

Return type:

List[_Permission]

static tenants(*, collection, tenant=None, create=False, read=False, update=False, delete=False)[source]
Parameters:
  • collection (str | Sequence[str])

  • tenant (str | Sequence[str] | None)

  • create (bool)

  • read (bool)

  • update (bool)

  • delete (bool)

Return type:

List[_Permission]

static users(*, user, create=False, read=False, update=False, delete=False, assign_and_revoke=False)[source]
Parameters:
  • user (str | Sequence[str])

  • create (bool)

  • read (bool)

  • update (bool)

  • delete (bool)

  • assign_and_revoke (bool)

Return type:

List[_Permission]

class weaviate.classes.rbac.RoleScope(*values)[source]

Bases: str, BaseEnum

Scope of the role permission.

MATCH = 'match'
ALL = 'all'

weaviate.classes.tenants

pydantic model weaviate.classes.tenants.Tenant[source]

Bases: BaseModel

Tenant class used to describe a tenant in Weaviate.

name

The name of the tenant.

activity_status

TenantActivityStatus, default: “HOT”

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 activityStatus: _TenantActivistatusServerValues = _TenantActivistatusServerValues.HOT
field activityStatusInternal: TenantActivityStatus = TenantActivityStatus.ACTIVE (alias 'activity_status')
field name: str [Required]
_model_post_init(user_input)[source]
Parameters:

user_input (bool)

Return type:

None

model_post_init(_Tenant__context)[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

_Tenant__context (Any)

Return type:

None

_abc_impl = <_abc._abc_data object>
property activity_status: TenantActivityStatus

Getter for the activity status of the tenant.

pydantic model weaviate.classes.tenants.TenantCreate[source]

Bases: BaseModel

Tenant class used to describe a tenant to create in Weaviate.

name

the name of the tenant.

activity_status

TenantCreateActivityStatus, default: “HOT”

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 activityStatus: _TenantActivistatusServerValues = _TenantActivistatusServerValues.HOT
field activityStatusInternal: TenantCreateActivityStatus = TenantCreateActivityStatus.ACTIVE (alias 'activity_status')
field name: str [Required]
model_post_init(_TenantCreate__context)[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

_TenantCreate__context (Any)

Return type:

None

_abc_impl = <_abc._abc_data object>
property activity_status: TenantCreateActivityStatus

Getter for the activity status of the tenant.

pydantic model weaviate.classes.tenants.TenantUpdate[source]

Bases: BaseModel

Tenant class used to describe a tenant to create in Weaviate.

name

The name of the tenant.

activity_status

TenantUpdateActivityStatus, default: “HOT”

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 activityStatus: _TenantActivistatusServerValues = _TenantActivistatusServerValues.HOT
field activityStatusInternal: TenantUpdateActivityStatus = TenantUpdateActivityStatus.ACTIVE (alias 'activity_status')
field name: str [Required]
model_post_init(_TenantUpdate__context)[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

Parameters:

_TenantUpdate__context (Any)

Return type:

None

_abc_impl = <_abc._abc_data object>
property activity_status: TenantUpdateActivityStatus

Getter for the activity status of the tenant.

class weaviate.classes.tenants.TenantActivityStatus(*values)[source]

Bases: str, Enum

TenantActivityStatus class used to describe the activity status of a tenant in Weaviate.

ACTIVE

The tenant is fully active and can be used.

INACTIVE

The tenant is not active, files stored locally.

OFFLOADED

The tenant is not active, files stored on the cloud.

OFFLOADING

The tenant is in the process of being offloaded.

ONLOADING

The tenant is in the process of being activated.

HOT

DEPRECATED, please use ACTIVE. The tenant is fully active and can be used.

COLD

DEPRECATED, please use INACTIVE. The tenant is not active, files stored locally.

FROZEN

DEPRECATED, please use OFFLOADED. The tenant is not active, files stored on the cloud.

ACTIVE = 'ACTIVE'
INACTIVE = 'INACTIVE'
OFFLOADED = 'OFFLOADED'
OFFLOADING = 'OFFLOADING'
ONLOADING = 'ONLOADING'
HOT = 'HOT'
COLD = 'COLD'
FROZEN = 'FROZEN'
class weaviate.classes.tenants.TenantCreateActivityStatus(*values)[source]

Bases: str, Enum

TenantActivityStatus class used to describe the activity status of a tenant to create in Weaviate.

ACTIVE

The tenant is fully active and can be used.

INACTIVE

The tenant is not active, files stored locally.

HOT

DEPRECATED, please use ACTIVE. The tenant is fully active and can be used.

COLD

DEPRECATED, please use INACTIVE. The tenant is not active, files stored locally.

ACTIVE = 'ACTIVE'
INACTIVE = 'INACTIVE'
HOT = 'HOT'
COLD = 'COLD'
class weaviate.classes.tenants.TenantUpdateActivityStatus(*values)[source]

Bases: str, Enum

TenantActivityStatus class used to describe the activity status of a tenant to update in Weaviate.

ACTIVE

The tenant is fully active and can be used.

INACTIVE

The tenant is not active, files stored locally.

OFFLOADED

The tenant is not active, files stored on the cloud.

HOT

DEPRECATED, please use ACTIVE. The tenant is fully active and can be used.

COLD

DEPRECATED, please use INACTIVE. The tenant is not active, files stored locally.

FROZEN

DEPRECATED, please use OFFLOADED. The tenant is not active, files stored on the cloud.

ACTIVE = 'ACTIVE'
INACTIVE = 'INACTIVE'
OFFLOADED = 'OFFLOADED'
HOT = 'HOT'
COLD = 'COLD'
FROZEN = 'FROZEN'