weaviate.classes
- class weaviate.classes.ConsistencyLevel(*values)[source]
Bases:
str,BaseEnumThe 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
- class weaviate.classes.aggregate.GroupByAggregate(*, prop, limit=None)[source]
Bases:
_WeaviateInputDefine 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.
- Parameters:
prop (str)
limit (int | None)
- prop: str
- limit: int | None
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.aggregate.Metrics(property_)[source]
Bases:
objectDefine 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)
- text(count=False, top_occurrences_count=False, top_occurrences_value=False, limit=None, 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) – (Deprecated) The maximum number of top occurrences to return. Use limit instead.
limit (int | None) – The maximum number of top occurrences to return.
- Returns:
A _MetricsStr object that includes the metrics to be returned.
- Return type:
- 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:
- 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:
- 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:
- 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:
- 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:
weaviate.classes.backup
- class weaviate.classes.backup.BackupCompressionLevel(*values)[source]
Bases:
str,EnumWhich compression level should be used to compress the backup.
- DEFAULT = 'DefaultCompression'
- BEST_SPEED = 'BestSpeed'
- BEST_COMPRESSION = 'BestCompression'
- ZSTD_BEST_SPEED = 'ZstdBestSpeed'
- ZSTD_DEFAULT = 'ZstdDefaultCompression'
- ZSTD_BEST_COMPRESSION = 'ZstdBestCompression'
- NO_COMPRESSION = 'NoCompression'
- class weaviate.classes.backup.BackupConfigCreate(*, cpu_percentage=None, chunk_size=None, compression_level=None)[source]
Bases:
_BackupConfigBaseOptions 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.
- Parameters:
cpu_percentage (int | None)
chunk_size (int | None)
compression_level (BackupCompressionLevel | None)
- ChunkSize: int | None
- CompressionLevel: BackupCompressionLevel | None
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.backup.BackupConfigRestore(*, cpu_percentage=None)[source]
Bases:
_BackupConfigBaseOptions 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.
- Parameters:
cpu_percentage (int | None)
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.backup.BackupStorage(*values)[source]
Bases:
str,EnumWhich backend should be used to write the backup to.
- FILESYSTEM = 'filesystem'
- S3 = 's3'
- GCS = 'gcs'
- AZURE = 'azure'
- class weaviate.classes.backup.BackupLocation[source]
Bases:
objectThe dynamic path of a backup.
- FileSystem
alias of
_BackupLocationFilesystem
- S3
alias of
_BackupLocationS3
- GCP
alias of
_BackupLocationGCP
- Azure
alias of
_BackupLocationAzure
weaviate.classes.batch
- class weaviate.classes.batch.Shard(*, collection, tenant=None)[source]
Bases:
BaseModelUse 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.
- Parameters:
collection (str)
tenant (str | None)
- collection: str
- tenant: str | None
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
weaviate.classes.config
- class weaviate.classes.config.Configure[source]
Bases:
objectUse 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
- Vectorizer
alias of
_Vectorizer
- VectorIndex
alias of
_VectorIndex
- NamedVectors
alias of
_NamedVectors
- Vectors
alias of
_Vectors
- MultiVectors
alias of
_MultiVectors
- ObjectTTL
alias of
_ObjectTTL
- Replication
alias of
_Replication
- static text_analyzer(ascii_fold=None, ascii_fold_ignore=None, stopword_preset=None)[source]
Create a text analyzer config for a property.
- Parameters:
ascii_fold (bool | None) – If True, accent/diacritic marks are folded to their base characters during indexing and search (e.g. ‘école’ matches ‘ecole’).
ascii_fold_ignore (List[str] | None) – Optional list of characters that should be excluded from ASCII folding (e.g.
['é']keeps ‘é’ from being folded to ‘e’). Requiresascii_fold=True.stopword_preset (StopwordsPreset | str | None) – Stopword preset name to override the collection-level stopwords for this property. Accepts a
StopwordsPresetor a user-defined preset name.
- Return type:
- 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, stopword_presets=None)[source]
Create an InvertedIndexConfigCreate object to be used when defining the configuration of the keyword searching algorithm of Weaviate.
- Parameters:
stopword_presets (Dict[str, List[str]] | None) – User-defined named stopword lists keyed by preset name. Each value is a flat list of stopword strings. A preset can be referenced from a property’s text_analyzer.stopword_preset to override the collection-level stopwords for that property only. Requires Weaviate >= 1.37.0.
<https (See `the docs) –
//weaviate.io/developers/weaviate/configuration/indexes#configure-the-inverted-index>`_ for details on the other parameters.
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:
- 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:
- static replication(factor=None, async_enabled=None, deletion_strategy=None, async_config=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.
async_config (_AsyncReplicationConfigCreate | None) – The configuration for async replication. This is only relevant if async_enabled is True.
- Return type:
- 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:
- class weaviate.classes.config.ConsistencyLevel(*values)[source]
Bases:
str,BaseEnumThe 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:
objectUse 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
- Vectors
alias of
_VectorsUpdate
- VectorIndex
alias of
_VectorIndexUpdate
- Generative
alias of
_Generative
- ObjectTTL
alias of
_ObjectTTLUpdate
- Replication
alias of
_ReplicationUpdate
- static inverted_index(bm25_b=None, bm25_k1=None, cleanup_interval_seconds=None, stopwords_additions=None, stopwords_preset=None, stopwords_removals=None, stopword_presets=None)[source]
Create an InvertedIndexConfigUpdate object.
Use this method when defining the inverted_index_config argument in collection.update().
- Parameters:
stopword_presets (Dict[str, List[str]] | None) – User-defined named stopword lists keyed by preset name. Each value is a flat list of stopword strings. Passing this replaces the entire user-defined stopword preset map for the collection. Removing a preset still referenced by a property is rejected by the server. Requires Weaviate >= 1.37.0.
<https (See `the docs) –
//weaviate.io/developers/weaviate/configuration/indexes#configure-the-inverted-index>`_ for details on the other parameters.
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:
- static replication(factor=None, async_enabled=None, deletion_strategy=None, async_config=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.
async_config (_AsyncReplicationConfigUpdate | None) – The async replication configuration. This is only applicable if async_enabled is set to True.
- Return type:
- 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:
- class weaviate.classes.config.DataType(*values)[source]
Bases:
str,BaseEnumThe 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.
- BLOB_HASH
Blob hash 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'
- BLOB_HASH = 'blobHash'
- PHONE_NUMBER = 'phoneNumber'
- OBJECT = 'object'
- OBJECT_ARRAY = 'object[]'
- class weaviate.classes.config.GenerativeSearches(*values)[source]
Bases:
str,BaseEnumThe 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.
- CONTEXTUALAI
Weaviate module backed by ContextualAI 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'
- CONTEXTUALAI = 'generative-contextualai'
- 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 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
- class weaviate.classes.config.Multi2VecField(*, name, weight=None)[source]
Bases:
BaseModelUse 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.
- Parameters:
name (str)
weight (float | None)
- name: str
- weight: float | None
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.config.MultiVectorAggregation(*values)[source]
Bases:
str,BaseEnumAggregation type to use for multivector indices.
- MAX_SIM
Maximum similarity.
- MAX_SIM = 'maxSim'
- class weaviate.classes.config.ReplicationDeletionStrategy(*values)[source]
Bases:
str,BaseEnumHow 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'
- class weaviate.classes.config.Property(*, name, data_type, description=None, index_filterable=None, index_searchable=None, index_range_filters=None, nested_properties=None, skip_vectorization=False, text_analyzer=None, tokenization=None, vectorize_property_name=True)[source]
Bases:
_ConfigCreateModelThis class defines the structure of a data property that a collection can have within Weaviate.
- Parameters:
name (str)
data_type (DataType)
description (str | None)
index_filterable (bool | None)
index_searchable (bool | None)
index_range_filters (bool | None)
skip_vectorization (bool)
text_analyzer (_TextAnalyzerConfigCreate | None)
tokenization (Tokenization | None)
vectorize_property_name (bool)
- name
The name of the property, REQUIRED.
- Type:
str
- data_type
The data type of the property, REQUIRED.
- description
A description of the property.
- Type:
str | None
- 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.
- Type:
bool
- text_analyzer
Text analysis options for the property. Configures ASCII folding behavior for text and text[] properties using an inverted index. Immutable after the property is created.
- tokenization
The tokenization method to use for the inverted index. Defaults to None.
- Type:
- vectorize_property_name
Whether to vectorize the property name. Defaults to True.
- Type:
bool
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.
- name: str
- description: str | None
- indexFilterable: bool | None
- indexSearchable: bool | None
- indexRangeFilters: bool | None
- skip_vectorization: bool
- textAnalyzer: _TextAnalyzerConfigCreate | None
- tokenization: Tokenization | None
- vectorize_property_name: bool
- _to_dict(vectorizers=None)[source]
- Parameters:
vectorizers (Sequence[Vectorizers | _EnumLikeStr] | None)
- Return type:
Dict[str, Any]
- _abc_impl = <_abc._abc_data object>
- model_config = {'strict': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.config.PQEncoderDistribution(*values)[source]
Bases:
str,BaseEnumDistribution 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,BaseEnumType of the PQ encoder.
- KMEANS
K-means encoder.
- TILE
Tile encoder.
- KMEANS = 'kmeans'
- TILE = 'tile'
- class weaviate.classes.config.ReferenceProperty(*, name, target_collection, description=None)[source]
Bases:
_ReferencePropertyBaseThis 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.
- Parameters:
name (str)
target_collection (str)
description (str | None)
- name
The name of the property, REQUIRED.
- target_collection
The name of the target collection, REQUIRED.
- Type:
str
- description
A description of the property.
- Type:
str | None
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.
- target_collection: str
- description: str | None
- MultiTarget
alias of
_ReferencePropertyMultiTarget
- _abc_impl = <_abc._abc_data object>
- model_config = {'strict': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.config.Rerankers(*values)[source]
Bases:
str,BaseEnumThe 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.
- CONTEXTUALAI
Weaviate module backed by ContextualAI 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'
- CONTEXTUALAI = 'reranker-contextualai'
- TRANSFORMERS = 'reranker-transformers'
- VOYAGEAI = 'reranker-voyageai'
- JINAAI = 'reranker-jinaai'
- NVIDIA = 'reranker-nvidia'
- weaviate.classes.config.StopwordsCreate
alias of
_StopwordsCreate
- class weaviate.classes.config.StopwordsPreset(*values)[source]
Bases:
str,BaseEnumPreset stopwords to use in the Stopwords class.
- EN
English stopwords.
- NONE
No stopwords.
- NONE = 'none'
- EN = 'en'
- weaviate.classes.config.TextAnalyzerConfig
alias of
_TextAnalyzerConfig
- weaviate.classes.config.TextAnalyzerConfigCreate
alias of
_TextAnalyzerConfigCreate
- class weaviate.classes.config.Tokenization(*values)[source]
Bases:
str,BaseEnumThe 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).
- GSE_CH
Tokenize using GSE (for Chinese).
- WORD = 'word'
- WHITESPACE = 'whitespace'
- LOWERCASE = 'lowercase'
- FIELD = 'field'
- GSE = 'gse'
- TRIGRAM = 'trigram'
- KAGOME_JA = 'kagome_ja'
- KAGOME_KR = 'kagome_kr'
- GSE_CH = 'gse_ch'
- class weaviate.classes.config.Vectorizers(*values)[source]
Bases:
str,EnumThe 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_DIGITALOCEAN = 'text2vec-digitalocean'
- TEXT2VEC_GPT4ALL = 'text2vec-gpt4all'
- TEXT2VEC_HUGGINGFACE = 'text2vec-huggingface'
- TEXT2VEC_MISTRAL = 'text2vec-mistral'
- TEXT2VEC_MORPH = 'text2vec-morph'
- TEXT2VEC_MODEL2VEC = 'text2vec-model2vec'
- 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_AWS = 'multi2vec-aws'
- MULTI2VEC_CLIP = 'multi2vec-clip'
- MULTI2VEC_COHERE = 'multi2vec-cohere'
- MULTI2VEC_JINAAI = 'multi2vec-jinaai'
- MULTI2MULTI_JINAAI = 'multi2multivec-jinaai'
- MULTI2MULTI_WEAVIATE = 'multi2multivec-weaviate'
- 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,EnumVector 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'
- DOT = 'dot'
- L2_SQUARED = 'l2-squared'
- HAMMING = 'hamming'
- MANHATTAN = 'manhattan'
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
- uuid: str | UUID | None = None
- vector: Mapping[str, Sequence[int | float] | Sequence[Sequence[int | float]]] | Sequence[int | float] | None = None
- references: R = None
- class weaviate.classes.data.DataReference(from_property, from_uuid, to_uuid)[source]
Bases:
_DataReferenceThis 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
- class weaviate.classes.data.GeoCoordinate(*, latitude, longitude)[source]
Bases:
_WeaviateInputInput 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.
- Parameters:
latitude (Annotated[float, Ge(ge=-90), Le(le=90)])
longitude (Annotated[float, Ge(ge=-180), Le(le=180)])
- latitude: float
- longitude: float
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.data.PhoneNumber(*, number, default_country=None)[source]
Bases:
_PhoneNumberBaseInput 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.
- Parameters:
number (str)
default_country (str | None)
- default_country: str | None
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.data.ReferenceToMulti(*, target_collection, uuids)[source]
Bases:
_WeaviateInputUse 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.
- Parameters:
target_collection (str)
uuids (Sequence[str | UUID] | str | UUID)
- target_collection: str
- uuids: Sequence[str | UUID] | str | UUID
- property uuids_str: List[str]
Returns the UUIDs as strings.
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
weaviate.classes.debug
- class weaviate.classes.debug.DebugRESTObject(*, collection, creationTimeUnix, lastUpdateTimeUnix, properties, tenant=None, id, vector=None, vectors=None)[source]
Bases:
BaseModelCreate 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.
- Parameters:
collection (str)
creationTimeUnix (datetime)
lastUpdateTimeUnix (datetime)
properties (Dict[str, Any])
tenant (str | None)
id (UUID)
vector (list[float] | None)
vectors (Dict[str, list[float]] | None)
- collection: str
- creation_time: datetime
- last_update_time: datetime
- properties: Dict[str, Any]
- tenant: str | None
- uuid: UUID
- vector: list[float] | None
- vectors: Dict[str, list[float]] | None
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
weaviate.classes.generics
- class weaviate.classes.generics.CrossReferenceAnnotation(include_vector=False, metadata=None, target_collection=None)[source]
Bases:
objectDataclass 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 client_credentials(client_secret, scope=None)[source]
- Parameters:
client_secret (str)
scope (str | List[str] | None)
- Return type:
- static client_password(username, password, scope=None)[source]
- Parameters:
username (str)
password (str)
scope (str | List[str] | None)
- Return type:
- class weaviate.classes.init.AdditionalConfig(*, connection=<factory>, proxies=None, timeout=<factory>, trust_env=False, grpc_config=None)[source]
Bases:
BaseModelUse 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.
- Parameters:
connection (ConnectionConfig)
proxies (str | Proxies | None)
timeout (Tuple[int, int] | Timeout)
trust_env (bool)
grpc_config (GrpcConfig | None)
- connection: ConnectionConfig
- trust_env: bool
- grpc_config: GrpcConfig | None
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.init.GrpcConfig(*, channel_options=None, credentials=None)[source]
Bases:
BaseModelConfiguration for the gRPC channel used by the Weaviate client. Use this to customize TLS/SSL settings for gRPC connections.
- To provide your own channel_options, supply a list of tuples where each tuple contains the name of the gRPC channel option and its corresponding value.
- To provide your own credentials, use the ssl_channel_credentials() function from the grpc library to build a ChannelCredentials object.
Example usage: ```python from grpc import ssl_channel_credentials import weaviate.classes as wvc
- conf = wvc.init.GrpcConfig(
- channel_options=[
(“grpc.keepalive_time_ms”, 10000), (“grpc.keepalive_timeout_ms”, 5000),
], credentials=ssl_channel_credentials(…),
)
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.
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- channel_options: Sequence[Tuple[str, Any]] | None
- credentials: ChannelCredentials | None
- _abc_impl = <_abc._abc_data object>
- Parameters:
channel_options (Sequence[Tuple[str, Any]] | None)
credentials (ChannelCredentials | None)
- class weaviate.classes.init.Proxies(*, http=None, https=None, grpc=None)[source]
Bases:
BaseModelProxy 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.
- Parameters:
http (str | None)
https (str | None)
grpc (str | None)
- http: str | None
- https: str | None
- grpc: str | None
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.init.Timeout(*, query=30, insert=90, init=2, stream=None)[source]
Bases:
BaseModelTimeouts 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.
- Parameters:
query (Annotated[int | float, Ge(ge=0)])
insert (Annotated[int | float, Ge(ge=0)])
init (Annotated[int | float, Ge(ge=0)])
stream (Annotated[int | float | None, Ge(ge=0)])
- query: int | float
- insert: int | float
- init: int | float
- stream: int | float | None
- _abc_impl = <_abc._abc_data object>
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
weaviate.classes.query
- class weaviate.classes.query.Diversity[source]
Bases:
objectUse this factory class to apply diversity selection to search results via MMR.
- class weaviate.classes.query.Filter[source]
Bases:
objectThis 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 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:
- 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:
- 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:
- static by_id()[source]
Define a filter based on the uuid to be used when querying and deleting from a collection.
- Return type:
- 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:
- 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:
- 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:
- class weaviate.classes.query.GeoCoordinate(*, latitude, longitude)[source]
Bases:
_WeaviateInputInput 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.
- Parameters:
latitude (Annotated[float, Ge(ge=-90), Le(le=90)])
longitude (Annotated[float, Ge(ge=-180), Le(le=180)])
- latitude: float
- longitude: float
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.query.GenerativeConfig[source]
Bases:
objectUse 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, max_tokens=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
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
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 aws_bedrock(*, endpoint=None, max_tokens=None, model=None, region=None, temperature=None, top_k=None, top_p=None, stop_sequences=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
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
region (str | None) – The AWS region to run the model from. 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
stop_sequences (List[str] | None) – The stop sequences to use. Defaults to None, which uses the server-defined default
- Return type:
_GenerativeConfigRuntime
- static aws_sagemaker(*, endpoint=None, max_tokens=None, region=None, target_model=None, target_variant=None, temperature=None, top_k=None, top_p=None, stop_sequences=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
max_tokens (int | None) – The maximum number of tokens to generate. 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
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
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
stop_sequences (List[str] | None) – The stop sequences 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 contextualai(*, model=None, max_new_tokens=None, temperature=None, top_p=None, system_prompt=None, avoid_commentary=None, knowledge=None)[source]
Create a _GenerativeContextualAI object for use with the generative-contextualai module.
- Parameters:
model (str | None) – The model to use. Defaults to None, which uses the server-defined default
max_new_tokens (int | None) – The maximum number of tokens 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 to use. Defaults to None, which uses the server-defined default
system_prompt (str | None) – The system prompt to prepend to the conversation
avoid_commentary (bool | None) – Whether to avoid model commentary in responses
knowledge (List[str] | None) – Optional knowledge array to override the default knowledge from retrieved objects
- 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 google_vertex(*, api_endpoint=None, project_id=None, endpoint_id=None, region=None, frequency_penalty=None, max_tokens=None, model=None, presence_penalty=None, temperature=None, top_k=None, top_p=None, stop_sequences=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 google_gemini(*, frequency_penalty=None, max_tokens=None, model=None, presence_penalty=None, temperature=None, top_k=None, top_p=None, stop_sequences=None)[source]
Create a _GenerativeGoogle object for use when performing AI generation using the generative-google module.
See the documentation for detailed usage.
- Parameters:
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
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, reasoning_effort=None, resource_name=None, stop=None, temperature=None, top_p=None, verbosity=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
reasoning_effort (Literal['minimal', 'low', 'medium', 'high'] | str | None) – The reasoning effort 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
verbosity (Literal['low', 'medium', 'high'] | str | None) – The verbosity 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 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
- class weaviate.classes.query.GroupBy(*, prop, objects_per_group, number_of_groups)[source]
Bases:
_WeaviateInputDefine 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.
- Parameters:
prop (str)
objects_per_group (int)
number_of_groups (int)
- prop: str
- objects_per_group: int
- number_of_groups: int
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.query.HybridFusion(*values)[source]
Bases:
str,BaseEnumDefine 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:
objectUse 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:
- 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:
- weaviate.classes.query.BM25Operator
alias of
BM25OperatorFactory
- class weaviate.classes.query.MetadataQuery(*, creation_time=False, last_update_time=False, distance=False, certainty=False, score=False, explain_score=False, is_consistent=False, query_profile=False)[source]
Bases:
_WeaviateInputDefine 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.
- Parameters:
creation_time (bool)
last_update_time (bool)
distance (bool)
certainty (bool)
score (bool)
explain_score (bool)
is_consistent (bool)
query_profile (bool)
- creation_time: bool
- last_update_time: bool
- distance: bool
- certainty: bool
- score: bool
- explain_score: bool
- is_consistent: bool
- query_profile: bool
- classmethod full()[source]
Return a MetadataQuery with all fields set to True.
NOTE: query_profile is excluded because it adds performance overhead. Use full_with_profile() to include it.
- Return type:
- classmethod full_with_profile()[source]
Return a MetadataQuery with all fields set to True, including query profiling.
Query profiling adds per-shard execution timing breakdowns to the response but has performance overhead. Requires Weaviate >= 1.36.9.
- Return type:
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.query.Metrics(property_)[source]
Bases:
objectDefine 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)
- text(count=False, top_occurrences_count=False, top_occurrences_value=False, limit=None, 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) – (Deprecated) The maximum number of top occurrences to return. Use limit instead.
limit (int | None) – The maximum number of top occurrences to return.
- Returns:
A _MetricsStr object that includes the metrics to be returned.
- Return type:
- 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:
- 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:
- 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:
- 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:
- 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:
- class weaviate.classes.query.Move(force, objects=None, concepts=None)[source]
Bases:
objectDefine 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 _objects_list: List[str] | None
- property _concepts_list: List[str] | None
- class weaviate.classes.query.NearMediaType(*values)[source]
Bases:
str,EnumThe 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'
- class weaviate.classes.query.QueryNested[source]
Bases:
_WeaviateInputDefine 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.
- name: str
- properties: PROPERTIES
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.query.QueryReference[source]
Bases:
_QueryReferenceDefine 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>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.query.NearVector[source]
Bases:
objectFactory class to use when defining near vector queries with multiple vectors in near_vector() and hybrid() methods.
- class weaviate.classes.query.Rerank(*, prop, query=None)[source]
Bases:
_WeaviateInputDefine 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.
- Parameters:
prop (str)
query (str | None)
- prop: str
- query: str | None
- _abc_impl = <_abc._abc_data object>
- model_config = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class weaviate.classes.query.Sort[source]
Bases:
objectDefine how the query’s sort operation should be performed using the available static methods.
- static by_property(name, ascending=True)[source]
Sort by an object property in the collection.
- Parameters:
name (str)
ascending (bool)
- Return type:
- static by_id(ascending=True)[source]
Sort by an object’s ID in the collection.
- Parameters:
ascending (bool)
- Return type:
- class weaviate.classes.query.TargetVectors[source]
Bases:
objectDefine how the distances from different target vectors should be combined using the available methods.
- static sum(target_vectors)[source]
Combine the distance from different target vectors by summing them.
- Parameters:
target_vectors (List[str])
- Return type:
- static average(target_vectors)[source]
Combine the distance from different target vectors by averaging them.
- Parameters:
target_vectors (List[str])
- Return type:
- static minimum(target_vectors)[source]
Combine the distance from different target vectors by using the minimum distance.
- Parameters:
target_vectors (List[str])
- Return type:
- 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:
weaviate.classes.rbac
- class weaviate.classes.rbac.Actions[source]
Bases:
object- Alias
alias of
AliasAction
- Data
alias of
DataAction
- Collections
alias of
CollectionsAction
- Roles
alias of
RolesAction
- Cluster
alias of
ClusterAction
- Nodes
alias of
NodesAction
- Backups
alias of
BackupsAction
- Tenants
alias of
TenantsAction
- Users
alias of
UsersAction
- Replicate
alias of
ReplicateAction
- Groups
alias of
GroupAction
- class weaviate.classes.rbac.Permissions[source]
Bases:
object- Nodes
alias of
NodesPermissions
- Groups
alias of
GroupsPermissions
- static alias(*, alias, collection, create=False, read=False, update=False, delete=False)[source]
- Parameters:
alias (str | Sequence[str])
collection (str | Sequence[str])
create (bool)
read (bool)
update (bool)
delete (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 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 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 replicate(*, collection, shard=None, create=False, read=False, update=False, delete=False)[source]
- Parameters:
collection (str | Sequence[str])
shard (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 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]
- static backup(*, collection, manage=False)[source]
- Parameters:
collection (str | Sequence[str])
manage (bool)
- Return type:
List[_Permission]
- static mcp(*, create=False, read=False, update=False)[source]
- Parameters:
create (bool)
read (bool)
update (bool)
- Return type:
List[_Permission]
- static cluster(*, read=False)[source]
- Parameters:
read (bool)
- Return type:
List[_Permission]
weaviate.classes.tenants
- class weaviate.classes.tenants.Tenant(*, name, activity_status=TenantActivityStatus.ACTIVE, activityStatus=_TenantActivistatusServerValues.HOT)[source]
Bases:
BaseModelTenant class used to describe a tenant in Weaviate.
- Parameters:
name (str)
activity_status (TenantActivityStatus)
activityStatus (_TenantActivistatusServerValues)
- name
The name of the tenant.
- Type:
str
- 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.
- model_config = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str
- activityStatusInternal: TenantActivityStatus
- activityStatus: _TenantActivistatusServerValues
- property activity_status: TenantActivityStatus
Getter for the activity status of the tenant.
- 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>
- class weaviate.classes.tenants.TenantCreate(*, name, activity_status=TenantCreateActivityStatus.ACTIVE, activityStatus=_TenantActivistatusServerValues.HOT)[source]
Bases:
BaseModelTenant class used to describe a tenant to create in Weaviate.
- Parameters:
name (str)
activity_status (TenantCreateActivityStatus)
activityStatus (_TenantActivistatusServerValues)
- name
the name of the tenant.
- Type:
str
- 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.
- model_config = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str
- activityStatusInternal: TenantCreateActivityStatus
- activityStatus: _TenantActivistatusServerValues
- property activity_status: TenantCreateActivityStatus
Getter for the activity status of the tenant.
- 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>
- class weaviate.classes.tenants.TenantUpdate(*, name, activity_status=TenantUpdateActivityStatus.ACTIVE, activityStatus=_TenantActivistatusServerValues.HOT)[source]
Bases:
BaseModelTenant class used to describe a tenant to create in Weaviate.
- Parameters:
name (str)
activity_status (TenantUpdateActivityStatus)
activityStatus (_TenantActivistatusServerValues)
- name
The name of the tenant.
- Type:
str
- 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.
- model_config = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str
- activityStatusInternal: TenantUpdateActivityStatus
- activityStatus: _TenantActivistatusServerValues
- property activity_status: TenantUpdateActivityStatus
Getter for the activity status of the tenant.
- 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>
- class weaviate.classes.tenants.TenantActivityStatus(*values)[source]
Bases:
str,EnumTenantActivityStatus 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,EnumTenantActivityStatus 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,EnumTenantActivityStatus 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'