weaviate.collections.classes package

Submodules

weaviate.collections.classes.aggregate module

class weaviate.collections.classes.aggregate.AggregateBoolean(count: int | None, percentage_false: float | None, percentage_true: float | None, total_false: int | None, total_true: int | None)[source]

Bases: object

The aggregation result for a boolean property.

count: int | None
percentage_false: float | None
percentage_true: float | None
total_false: int | None
total_true: int | None
class weaviate.collections.classes.aggregate.AggregateDate(count: int | None, maximum: str | None, median: str | None, minimum: str | None, mode: str | None)[source]

Bases: object

The aggregation result for a date property.

count: int | None
maximum: str | None
median: str | None
minimum: str | None
mode: str | None
class weaviate.collections.classes.aggregate.AggregateGroup(grouped_by: GroupedBy, properties: Dict[str, AggregateInteger | AggregateNumber | AggregateText | AggregateBoolean | AggregateDate], total_count: int | None)[source]

Bases: object

The aggregation result for a collection grouped by a property.

grouped_by: GroupedBy
properties: Dict[str, AggregateInteger | AggregateNumber | AggregateText | AggregateBoolean | AggregateDate]
total_count: int | None
class weaviate.collections.classes.aggregate.AggregateGroupByReturn(groups: List[AggregateGroup])[source]

Bases: object

The aggregation results for a collection grouped by a property.

groups: List[AggregateGroup]
class weaviate.collections.classes.aggregate.AggregateInteger(count: int | None, maximum: int | None, mean: float | None, median: float | None, minimum: int | None, mode: int | None, sum_: int | None)[source]

Bases: object

The aggregation result for an int property.

count: int | None
maximum: int | None
mean: float | None
median: float | None
minimum: int | None
mode: int | None
sum_: int | None
class weaviate.collections.classes.aggregate.AggregateNumber(count: int | None, maximum: float | None, mean: float | None, median: float | None, minimum: float | None, mode: float | None, sum_: float | None)[source]

Bases: object

The aggregation result for a number property.

count: int | None
maximum: float | None
mean: float | None
median: float | None
minimum: float | None
mode: float | None
sum_: float | None
class weaviate.collections.classes.aggregate.AggregateReturn(properties: Dict[str, AggregateInteger | AggregateNumber | AggregateText | AggregateBoolean | AggregateDate], total_count: int | None)[source]

Bases: object

The aggregation result for a collection.

properties: Dict[str, AggregateInteger | AggregateNumber | AggregateText | AggregateBoolean | AggregateDate]
total_count: int | None
class weaviate.collections.classes.aggregate.AggregateText(count: int | None, top_occurrences: List[TopOccurrence])[source]

Bases: object

The aggregation result for a text property.

count: int | None
top_occurrences: List[TopOccurrence]
pydantic model weaviate.collections.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]
class weaviate.collections.classes.aggregate.GroupedBy(prop: str, value: str)[source]

Bases: object

The property that the collection was grouped by.

prop: str
value: str
class weaviate.collections.classes.aggregate.Metrics(property_: str)[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](https://weaviate.io/developers/weaviate/search/aggregate) for more details!

boolean(count: bool = False, percentage_false: bool = False, percentage_true: bool = False, total_false: bool = False, total_true: bool = False) _MetricsBoolean[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.

Arguments:
count

Whether to include the number of objects that contain this property.

percentage_false

Whether to include the percentage of objects that have a false value for this property.

percentage_true

Whether to include the percentage of objects that have a true value for this property.

total_false

Whether to include the total number of objects that have a false value for this property.

total_true

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.

date_(count: bool = False, maximum: bool = False, median: bool = False, minimum: bool = False, mode: bool = False) _MetricsDate[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.

Arguments:
count

Whether to include the number of objects that contain this property.

maximum

Whether to include the maximum value of this property.

median

Whether to include the median value of this property.

minimum

Whether to include the minimum value of this property.

mode

Whether to include the mode value of this property.

Returns:

A _MetricsDate object that includes the metrics to be returned.

integer(count: bool = False, maximum: bool = False, mean: bool = False, median: bool = False, minimum: bool = False, mode: bool = False, sum_: bool = False) _MetricsInteger[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.

Arguments:
count

Whether to include the number of objects that contain this property.

maximum

Whether to include the maximum value of this property.

mean

Whether to include the mean value of this property.

median

Whether to include the median value of this property.

minimum

Whether to include the minimum value of this property.

mode

Whether to include the mode value of this property.

sum_

Whether to include the sum of this property.

Returns:

A _MetricsInteger object that includes the metrics to be returned.

number(count: bool = False, maximum: bool = False, mean: bool = False, median: bool = False, minimum: bool = False, mode: bool = False, sum_: bool = False) _MetricsNumber[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.

Arguments:
count

Whether to include the number of objects that contain this property.

maximum

Whether to include the maximum value of this property.

mean

Whether to include the mean value of this property.

median

Whether to include the median value of this property.

minimum

Whether to include the minimum value of this property.

mode

Whether to include the mode value of this property.

sum_

Whether to include the sum of this property.

Returns:

A _MetricsNumber object that includes the metrics to be returned.

text(count: bool = False, top_occurrences_count: bool = False, top_occurrences_value: bool = False, min_occurrences: int | None = None) _MetricsText[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.

Arguments:
count

Whether to include the number of objects that contain this property.

top_occurrences_count

Whether to include the number of the top occurrences of a property’s value.

top_occurrences_value

Whether to include the value of the top occurrences of a property’s value.

min_occurrences

Only include entries with more occurrences than the given limit.

Returns:

A _MetricsStr object that includes the metrics to be returned.

class weaviate.collections.classes.aggregate.TopOccurrence(count: int | None, value: str | None)[source]

Bases: object

The top occurrence of a text property.

count: int | None
value: str | None

weaviate.collections.classes.batch module

pydantic model weaviate.collections.classes.batch.BatchObject[source]

Bases: BaseModel

A Weaviate object to be added to the database.

Performs validation on the class name and UUID, and automatically generates a UUID if one is not provided. Also converts the vector to a list of floats if it is provided as a numpy array.

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]
Constraints:
  • min_length = 1

Validated by:
  • _validate_collection

field properties: Dict[str, Any] | None = None
field references: Mapping[str, str | UUID | Sequence[str | UUID] | ReferenceToMulti] | None = None
field tenant: str | None = None
field uuid: str | UUID | None = None
field vector: Dict[str, List[float]] | List[float] | None = None
class weaviate.collections.classes.batch.BatchObjectReturn(all_responses: List[UUID | ErrorObject], elapsed_seconds: float, errors: Dict[int, ErrorObject], uuids: Dict[int, UUID], has_errors: bool = False)[source]

Bases: object

This class contains the results of a batch insert_many operation.

Since the individual objects within the batch can error for differing reasons, the data is split up within this class for ease use when performing error checking, handling, and data revalidation.

Attributes:
all_responses

A list of all the responses from the batch operation. Each response is either a uuid_package.UUID object or an Error object.

elapsed_seconds

The time taken to perform the batch operation.

errors

A dictionary of all the failed responses from the batch operation. The keys are the indices of the objects in the batch, and the values are the Error objects.

uuids

A dictionary of all the successful responses from the batch operation. The keys are the indices of the objects in the batch, and the values are the uuid_package.UUID objects.

has_errors

A boolean indicating whether or not any of the objects in the batch failed to be inserted. If this is True, then the errors dictionary will contain at least one entry.

all_responses: List[UUID | ErrorObject]
elapsed_seconds: float
errors: Dict[int, ErrorObject]
has_errors: bool = False
uuids: Dict[int, UUID]
pydantic model weaviate.collections.classes.batch.BatchReference[source]

Bases: BaseModel

A reference between two objects in Weaviate.

Performs validation on the class names and UUIDs.

Converts provided data to an internal object containing beacons for insertion into Weaviate.

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 from_object_collection: str [Required]
Constraints:
  • min_length = 1

Validated by:
  • _validate_from_object_collection

field from_object_uuid: str | UUID [Required]
Validated by:
  • _validate_uuids

field from_property_name: str [Required]
field tenant: str | None = None
field to_object_collection: str | None = None
Validated by:
  • _validate_to_object_collection

field to_object_uuid: str | UUID [Required]
Validated by:
  • _validate_uuids

class weaviate.collections.classes.batch.BatchReferenceReturn(elapsed_seconds: float, errors: Dict[int, ErrorReference], has_errors: bool = False)[source]

Bases: object

This class contains the results of a batch insert_many_references operation.

Since the individual references within the batch can error for differing reasons, the data is split up within this class for ease use when performing error checking, handling, and data revalidation.

Attributes:
elapsed_seconds

The time taken to perform the batch operation.

errors

A dictionary of all the failed responses from the batch operation. The keys are the indices of the references in the batch, and the values are the Error objects.

has_errors

A boolean indicating whether or not any of the references in the batch failed to be inserted. If this is True, then the errors dictionary will contain at least one entry.

elapsed_seconds: float
errors: Dict[int, ErrorReference]
has_errors: bool = False
class weaviate.collections.classes.batch.BatchResult[source]

Bases: object

This class contains the results of a batch operation.

Since the individual objects and references within the batch can error for differing reasons, the data is split up within this class for ease use when performing error checking, handling, and data revalidation.

Attributes:
objs

The results of the batch object operation.

refs

The results of the batch reference operation.

class weaviate.collections.classes.batch.DeleteManyObject(uuid: UUID, successful: bool, error: str | None = None)[source]

Bases: object

This class contains the objects of a delete_many operation.

error: str | None = None
successful: bool
uuid: UUID
class weaviate.collections.classes.batch.DeleteManyReturn(failed: int, matches: int, objects: T, successful: int)[source]

Bases: Generic[T]

This class contains the results of a delete_many operation..

failed: int
matches: int
objects: T
successful: int
class weaviate.collections.classes.batch.ErrorObject(message: str, object_: _BatchObject, original_uuid: str | UUID | None = None)[source]

Bases: object

This class contains the error information for a single object in a batch operation.

message: str
object_: _BatchObject
original_uuid: str | UUID | None = None
class weaviate.collections.classes.batch.ErrorReference(message: str, reference: _BatchReference)[source]

Bases: object

This class contains the error information for a single reference in a batch operation.

message: str
reference: _BatchReference
pydantic model weaviate.collections.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

weaviate.collections.classes.config module

weaviate.collections.classes.config.BM25Config

alias of _BM25Config

weaviate.collections.classes.config.BQConfig

alias of _BQConfig

weaviate.collections.classes.config.CollectionConfig

alias of _CollectionConfig

weaviate.collections.classes.config.CollectionConfigSimple

alias of _CollectionConfigSimple

class weaviate.collections.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: float | None = None, bm25_k1: float | None = None, cleanup_interval_seconds: int | None = None, index_timestamps: bool | None = None, index_property_length: bool | None = None, index_null_state: bool | None = None, stopwords_preset: StopwordsPreset | None = None, stopwords_additions: List[str] | None = None, stopwords_removals: List[str] | None = None) _InvertedIndexConfigCreate[source]

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

Arguments:

See [the docs](https://weaviate.io/developers/weaviate/configuration/indexes#configure-the-inverted-index) for details!

static multi_tenancy(enabled: bool = True) _MultiTenancyConfigCreate[source]

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

Arguments:
enabled

Whether multi-tenancy is enabled. Defaults to True.

static replication(factor: int | None = None) _ReplicationConfigCreate[source]

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

Arguments:
factor

The replication factor.

static sharding(virtual_per_physical: int | None = None, desired_count: int | None = None, actual_count: int | None = None, desired_virtual_count: int | None = None, actual_virtual_count: int | None = None) _ShardingConfigCreate[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](https://weaviate.io/developers/weaviate/concepts/replication-architecture#replication-vs-sharding) for more details.

Arguments:
virtual_per_physical

The number of virtual shards per physical shard.

desired_count

The desired number of physical shards.

actual_count

The actual number of physical shards.

desired_virtual_count

The desired number of virtual shards.

actual_virtual_count

The actual number of virtual shards.

class weaviate.collections.classes.config.ConsistencyLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

The consistency levels when writing to Weaviate with replication enabled.

Attributes:

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.collections.classes.config.DataType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

The available primitive data types in Weaviate.

Attributes:

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.

BLOB = 'blob'
BOOL = 'boolean'
BOOL_ARRAY = 'boolean[]'
DATE = 'date'
DATE_ARRAY = 'date[]'
GEO_COORDINATES = 'geoCoordinates'
INT = 'int'
INT_ARRAY = 'int[]'
NUMBER = 'number'
NUMBER_ARRAY = 'number[]'
OBJECT = 'object'
OBJECT_ARRAY = 'object[]'
PHONE_NUMBER = 'phoneNumber'
TEXT = 'text'
TEXT_ARRAY = 'text[]'
UUID = 'uuid'
UUID_ARRAY = 'uuid[]'
weaviate.collections.classes.config.GenerativeConfig

alias of _GenerativeConfig

class weaviate.collections.classes.config.GenerativeSearches(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

The available generative search modules in Weaviate.

These modules generate text from text-based inputs. See the [docs](https://weaviate.io/developers/weaviate/modules/reader-generator-modules) for more details.

Attributes:
OPENAI

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

COHERE

Weaviate module backed by Cohere generative models.

PALM

Weaviate module backed by PaLM generative models.

AWS

Weaviate module backed by AWS Bedrock generative models.

ANYSCALE = 'generative-anyscale'
AWS = 'generative-aws'
COHERE = 'generative-cohere'
MISTRAL = 'generative-mistral'
OPENAI = 'generative-openai'
PALM = 'generative-palm'
weaviate.collections.classes.config.InvertedIndexConfig

alias of _InvertedIndexConfig

weaviate.collections.classes.config.MultiTenancyConfig

alias of _MultiTenancyConfig

weaviate.collections.classes.config.NamedVectorConfig

alias of _NamedVectorConfig

weaviate.collections.classes.config.NestedProperty

alias of _NestedProperty

weaviate.collections.classes.config.PQConfig

alias of _PQConfig

weaviate.collections.classes.config.PQEncoderConfig

alias of _PQEncoderConfig

class weaviate.collections.classes.config.PQEncoderDistribution(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

Distribution of the PQ encoder.

Attributes:
LOG_NORMAL

Log-normal distribution.

NORMAL

Normal distribution.

LOG_NORMAL = 'log-normal'
NORMAL = 'normal'
class weaviate.collections.classes.config.PQEncoderType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

Type of the PQ encoder.

Attributes:
KMEANS

K-means encoder.

TILE

Tile encoder.

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

Bases: _ConfigCreateModel

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

Attributes:
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_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 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
weaviate.collections.classes.config.PropertyConfig

alias of _Property

weaviate.collections.classes.config.PropertyVectorizerConfig

alias of _PropertyVectorizerConfig

class weaviate.collections.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.

NamedVectors

alias of _NamedVectorsUpdate

VectorIndex

alias of _VectorIndexUpdate

static inverted_index(bm25_b: float | None = None, bm25_k1: float | None = None, cleanup_interval_seconds: int | None = None, stopwords_additions: List[str] | None = None, stopwords_preset: StopwordsPreset | None = None, stopwords_removals: List[str] | None = None) _InvertedIndexConfigUpdate[source]

Create an InvertedIndexConfigUpdate object.

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

Arguments:

See [the docs](https://weaviate.io/developers/weaviate/configuration/indexes#configure-the-inverted-index) for a more detailed view!

static replication(factor: int | None = None) _ReplicationConfigUpdate[source]

Create a ReplicationConfigUpdate object.

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

Arguments:
factor

The replication factor.

pydantic model weaviate.collections.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.

Attributes:
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

weaviate.collections.classes.config.ReferencePropertyConfig

alias of _ReferenceProperty

weaviate.collections.classes.config.ReplicationConfig

alias of _ReplicationConfig

weaviate.collections.classes.config.RerankerConfig

alias of _RerankerConfig

class weaviate.collections.classes.config.Rerankers(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

The available reranker modules in Weaviate.

These modules rerank the results of a search query. See the [docs](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules#re-ranking) for more details.

Attributes:
NONE

No reranker.

COHERE

Weaviate module backed by Cohere reranking models.

TRANSFORMERS

Weaviate module backed by Transformers reranking models.

COHERE = 'reranker-cohere'
NONE = 'none'
TRANSFORMERS = 'reranker-transformers'
VOYAGEAI = 'reranker-voyageai'
weaviate.collections.classes.config.ShardStatus

alias of _ShardStatus

weaviate.collections.classes.config.ShardingConfig

alias of _ShardingConfig

weaviate.collections.classes.config.StopwordsConfig

alias of _StopwordsConfig

class weaviate.collections.classes.config.StopwordsPreset(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

Preset stopwords to use in the Stopwords class.

Attributes:
EN

English stopwords.

NONE

No stopwords.

EN = 'en'
NONE = 'none'
class weaviate.collections.classes.config.Tokenization(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

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

Attributes:
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.

FIELD = 'field'
GSE = 'gse'
LOWERCASE = 'lowercase'
TRIGRAM = 'trigram'
WHITESPACE = 'whitespace'
WORD = 'word'
weaviate.collections.classes.config.VectorIndexConfigFlat

alias of _VectorIndexConfigFlat

weaviate.collections.classes.config.VectorIndexConfigHNSW

alias of _VectorIndexConfigHNSW

weaviate.collections.classes.config.VectorizerConfig

alias of _VectorizerConfig

weaviate.collections.classes.config_methods module

weaviate.collections.classes.data module

class weaviate.collections.classes.data.DataObject(properties: P = None, uuid: str | UUID | None = None, vector: Dict[str, List[float]] | List[float] | None = None, references: R = None)[source]

Bases: Generic[P, R]

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

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

Bases: _DataReference

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

MultiTarget

alias of DataReferenceMulti

class weaviate.collections.classes.data.DataReferenceMulti(from_property: str, from_uuid: str | UUID, to_uuid: str | UUID | List[str | UUID], target_collection: str)[source]

Bases: _DataReference

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

target_collection: str
class weaviate.collections.classes.data.Error(message: str, code: int | None = None, original_uuid: str | UUID | None = None)[source]

Bases: object

This class represents an error that occurred when attempting to insert an object within a batch.

code: int | None = None
message: str
original_uuid: str | UUID | None = None
class weaviate.collections.classes.data.RefError(message: str)[source]

Bases: object

This class represents an error that occurred when attempting to insert a reference between objects within a batch.

message: str

weaviate.collections.classes.filters module

class weaviate.collections.classes.filters.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](https://weaviate.io/developers/weaviate/search/filters) for more information.

static all_of(filters: List[_Filters]) _Filters[source]

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

static any_of(filters: List[_Filters]) _Filters[source]

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

static by_creation_time() _FilterByCreationTime[source]

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

static by_id() _FilterById[source]

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

static by_property(name: str, length: bool = False) _FilterByProperty[source]

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

static by_ref(link_on: str) _FilterByRef[source]

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

static by_ref_count(link_on: str) _FilterByCount[source]

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

static by_ref_multi_target(link_on: str, target_collection: str) _FilterByRef[source]

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

static by_update_time() _FilterByUpdateTime[source]

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

weaviate.collections.classes.filters.FilterByCreationTime

alias of _FilterByCreationTime

weaviate.collections.classes.filters.FilterById

alias of _FilterById

weaviate.collections.classes.filters.FilterByProperty

alias of _FilterByProperty

weaviate.collections.classes.filters.FilterByRef

alias of _FilterByRef

weaviate.collections.classes.filters.FilterByUpdateTime

alias of _FilterByUpdateTime

weaviate.collections.classes.filters.FilterReturn

alias of _Filters

weaviate.collections.classes.grpc module

pydantic model weaviate.collections.classes.grpc.Generate[source]

Bases: _WeaviateInput

Define how the query’s RAG capabilities 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 grouped_properties: List[str] | None = None
field grouped_task: str | None = None
field single_prompt: str | None = None
pydantic model weaviate.collections.classes.grpc.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]
class weaviate.collections.classes.grpc.HybridFusion(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[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'
pydantic model weaviate.collections.classes.grpc.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() MetadataQuery[source]

Return a MetadataQuery with all fields set to True.

class weaviate.collections.classes.grpc.Move(force: float, objects: List[str | UUID] | str | UUID | None = None, concepts: List[str] | str | None = None)[source]

Bases: object

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

class weaviate.collections.classes.grpc.NearMediaType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[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.collections.classes.grpc.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]
pydantic model weaviate.collections.classes.grpc.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

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

alias of _QueryReferenceMultiTarget

pydantic model weaviate.collections.classes.grpc.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
class weaviate.collections.classes.grpc.Sort[source]

Bases: object

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

static by_creation_time(ascending: bool = True) _Sorting[source]

Sort by an object’s creation time.

static by_id(ascending: bool = True) _Sorting[source]

Sort by an object’s ID in the collection.

static by_property(name: str, ascending: bool = True) _Sorting[source]

Sort by an object property in the collection.

static by_update_time(ascending: bool = True) _Sorting[source]

Sort by an object’s last update time.

weaviate.collections.classes.grpc.Sorting

The type returned by the Sort class to be used when defining programmatic sort chains.

weaviate.collections.classes.internal module

weaviate.collections.classes.internal.CrossReference

Use this TypeAlias when you want to type hint a cross reference within a generic data model.

If you want to define a reference property when creating your collection, use ReferenceProperty or ReferencePropertyMultiTarget instead.

If you want to create a reference when inserting an object, supply the UUIDs directly or use Reference.to_multi() instead.

Example:
>>> import typing
>>> import weaviate.classes as wvc
>>>
>>> class One(typing.TypedDict):
...     prop: str
>>>
>>> class Two(typing.TypedDict):
...     one: wvc.CrossReference[One]

alias of _CrossReference[Properties, IReferences]

class weaviate.collections.classes.internal.CrossReferenceAnnotation(include_vector: bool = False, metadata: MetadataQuery | None = None, target_collection: str | None = 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)
...     ]
include_vector: bool = False
metadata: MetadataQuery | None = None
target_collection: str | None = None
class weaviate.collections.classes.internal.GenerativeGroup(name: str, min_distance: float, max_distance: float, number_of_objects: int, objects: List[GroupByObject[P, R]], rerank_score: float | None, generated: str | None)[source]

Bases: Generic[P, R], Group[P, R]

A group of objects returned in a generative group by query.

generated: str | None
class weaviate.collections.classes.internal.GenerativeGroupByReturn(objects: List[GroupByObject[P, R]], groups: Dict[str, GenerativeGroup[P, R]], generated: str | None)[source]

Bases: Generic[P, R]

The return type of a query within the .generate namespace of a collection with the group_by argument specified.

generated: str | None
groups: Dict[str, GenerativeGroup[P, R]]
objects: List[GroupByObject[P, R]]
class weaviate.collections.classes.internal.GenerativeObject(uuid: UUID, metadata: M, properties: P, references: R, vector: Dict[str, List[float]], collection: str, generated: str | None)[source]

Bases: Generic[P, R], Object[P, R]

A single Weaviate object returned by a query within the generate namespace of a collection.

generated: str | None
class weaviate.collections.classes.internal.GenerativeReturn(objects: List[GenerativeObject[P, R]], generated: str | None)[source]

Bases: Generic[P, R]

The return type of a query within the generate namespace of a collection.

generated: str | None
objects: List[GenerativeObject[P, R]]
class weaviate.collections.classes.internal.Group(name: str, min_distance: float, max_distance: float, number_of_objects: int, objects: List[GroupByObject[P, R]], rerank_score: float | None)[source]

Bases: Generic[P, R]

A group of objects returned in a group by query.

max_distance: float
min_distance: float
name: str
number_of_objects: int
objects: List[GroupByObject[P, R]]
rerank_score: float | None
class weaviate.collections.classes.internal.GroupByMetadataReturn(distance: float | None = None)[source]

Bases: object

Metadata of an object returned by a group by query.

distance: float | None = None
class weaviate.collections.classes.internal.GroupByObject(uuid: UUID, metadata: M, properties: P, references: R, vector: Dict[str, List[float]], collection: str, belongs_to_group: str)[source]

Bases: Generic[P, R], _Object[P, R, GroupByMetadataReturn]

A single Weaviate object returned by a query with the group_by argument specified.

belongs_to_group: str
class weaviate.collections.classes.internal.GroupByReturn(objects: List[GroupByObject[P, R]], groups: Dict[str, Group[P, R]])[source]

Bases: Generic[P, R]

The return type of a query within the .query namespace of a collection with the group_by argument specified.

groups: Dict[str, Group[P, R]]
objects: List[GroupByObject[P, R]]
class weaviate.collections.classes.internal.MetadataReturn(creation_time: datetime | None = None, last_update_time: datetime | None = None, distance: float | None = None, certainty: float | None = None, score: float | None = None, explain_score: str | None = None, is_consistent: bool | None = None, rerank_score: float | None = None)[source]

Bases: object

Metadata of an object returned by a query.

certainty: float | None = None
creation_time: datetime | None = None
distance: float | None = None
explain_score: str | None = None
is_consistent: bool | None = None
last_update_time: datetime | None = None
rerank_score: float | None = None
score: float | None = None
class weaviate.collections.classes.internal.MetadataSingleObjectReturn(creation_time: datetime, last_update_time: datetime, is_consistent: bool | None)[source]

Bases: object

Metadata of an object returned by the fetch_object_by_id query.

creation_time: datetime
is_consistent: bool | None
last_update_time: datetime
class weaviate.collections.classes.internal.Object(uuid: UUID, metadata: M, properties: P, references: R, vector: Dict[str, List[float]], collection: str)[source]

Bases: Generic[P, R], _Object[P, R, MetadataReturn]

A single Weaviate object returned by a query within the .query namespace of a collection.

class weaviate.collections.classes.internal.ObjectSingleReturn(uuid: UUID, metadata: M, properties: P, references: R, vector: Dict[str, List[float]], collection: str)[source]

Bases: Generic[P, R], _Object[P, R, MetadataSingleObjectReturn]

A single Weaviate object returned by the fetch_object_by_id query.

class weaviate.collections.classes.internal.QueryReturn(objects: List[Object[P, R]])[source]

Bases: Generic[P, R]

The return type of a query within the .query namespace of a collection.

objects: List[Object[P, R]]
weaviate.collections.classes.internal.ReferenceInput

This type alias is used when providing references as inputs within the .data namespace of a collection.

alias of str | UUID | Sequence[str | UUID] | ReferenceToMulti

weaviate.collections.classes.internal.ReferenceInputs

This type alias is used when providing references as inputs within the .data namespace of a collection.

alias of Mapping[str, str | UUID | Sequence[str | UUID] | ReferenceToMulti]

pydantic model weaviate.collections.classes.internal.ReferenceToMulti[source]

Bases: _WeaviateInput

Use this class when you want to insert a multi-target reference 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 target_collection: str [Required]
field uuids: Sequence[str | UUID] | str | UUID [Required]
property uuids_str: List[str]

Returns the UUIDs as strings.

weaviate.collections.classes.orm module

weaviate.collections.classes.tenants module

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

Bases: BaseModel

Tenant class used to describe a tenant in Weaviate.

Attributes:
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: TenantActivityStatus = TenantActivityStatus.HOT (alias 'activity_status')
field name: str [Required]
property activity_status: TenantActivityStatus

Getter for the activity status of the tenant.

class weaviate.collections.classes.tenants.TenantActivityStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

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

Attributes:
HOT

The tenant is fully active and can be used.

COLD

The tenant is not active, files stored locally.

COLD = 'COLD'
HOT = 'HOT'

weaviate.collections.classes.types module

pydantic model weaviate.collections.classes.types.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

class weaviate.collections.classes.types.M

M is a completely general type that is used wherever generic metadata objects are defined that can be used

alias of TypeVar(‘M’)

class weaviate.collections.classes.types.P

P is a completely general type that is used wherever generic properties objects are defined that can be used within the non-ORM and ORM APIs interchangeably

alias of TypeVar(‘P’)

pydantic model weaviate.collections.classes.types.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
weaviate.collections.classes.types.PhoneNumberType

alias of _PhoneNumber

class weaviate.collections.classes.types.Properties

Properties is used wherever a single generic type is needed for properties

alias of TypeVar(‘Properties’, bound=Mapping[str, Any])

class weaviate.collections.classes.types.QP

QP is a completely general type that is used wherever generic properties objects are defined that can be used within the non-ORM and ORM APIs interchangeably

alias of TypeVar(‘QP’)

class weaviate.collections.classes.types.QR

QR is a completely general type that is used wherever generic reference objects are defined that can be used within the non-ORM and ORM APIs interchangeably

alias of TypeVar(‘QR’)

class weaviate.collections.classes.types.R

R is a completely general type that is used wherever generic reference objects are defined that can be used within the non-ORM and ORM APIs interchangeably

alias of TypeVar(‘R’)

class weaviate.collections.classes.types.References

References is used wherever a single generic type is needed for references

alias of TypeVar(‘References’, bound=Mapping[str, Any] | None)

class weaviate.collections.classes.types.T

T is a completely general type that is used in any kind of generic

alias of TypeVar(‘T’)

class weaviate.collections.classes.types.TProperties

TProperties is used alongside Properties wherever there are two generic types needed

E.g., in _DataCollection, Properties is used when defining the generic of the class while TProperties is used when defining the generic to be supplied in .with_data_model to create a new instance of _DataCollection with a different Properties type.

To be clear: _DataCollection[Properties]().with_data_model(TProperties) -> _DataCollection[TProperties]()

alias of TypeVar(‘TProperties’, bound=Mapping[str, Any])

class weaviate.collections.classes.types.TReferences

TReferences is used alongside References wherever there are two generic types needed

alias of TypeVar(‘TReferences’, bound=Mapping[str, Any] | None)