This minor version includes:
- Support for API-Keys
client = weaviate.Client(url, auth_client_secret=AuthApiKey(api_key="my-secret-key"))
This minor version includes:
- Extend CRUD operations for single data objects and reference with consistency level.
- Extend batch operations with consistency level.
- Add Cursor api.
- Add support for azure backup module.
This minor version includes:
- Adds with_generate in
~weaviate.gql.get.GetBuilder
which allows to use the generative openai module. Needs Weaviate with version >=v1.17.3. - Fix for empty OIDC scopes
- New startup_period parameter in
~weaviate.client.Client
. The client will wait for the given timeout for Weaviate to start. By default 5 seconds. - Improved error messages for where filters and authentication.
This minor version includes:
New status code attribute for
~weaviate.exceptions.UnexpectedStatusCodeException
that can be accessed like this:try: # your code except weaviate.UnexpectedStatusCodeException as err: print(err.status_code)
- Fix for
~weaviate.client.Client.get_meta
. - Caches server version at
~weaviate.client.Client
initialization. This improves batch reference creation performance. - Changes accepted data types for arguments
from_object_uuid
andto_object_uuid
of the method~weaviate.batch.Batch.add_reference
tostr
anduuid.UUID
. -
- Adds automatic retry for failed objects. It can be configured using the
weaviate_error_retries
argument for the~weaviate.batch.Batch.configure
or ~weaviate.batch.Batch.__call__
, and should be an instance of~weaviate.WeaviateErrorRetryConf
. It can be used like this:
All errors:
from weaviate import WeaviateErrorRetryConf with client.batch( weaviate_error_retries=WeaviateErrorRetryConf(number_retries=3), ) as batch: # Your code
Exclude errors, all the other errors will be retried:
from weaviate import WeaviateErrorRetryConf with client.batch( weaviate_error_retries=WeaviateErrorRetryConf(number_retries=3, errors_to_exclude=["Ignore me", "other error to ignore"]), ) as batch: # Your code
Include errors, all the other errors will be ignored:
from weaviate import WeaviateErrorRetryConf with client.batch( weaviate_error_retries=WeaviateErrorRetryConf(number_retries=3, errors_to_include=["error to retry", "other error to test again"]), ) as batch: # Your code
- Adds automatic retry for failed objects. It can be configured using the
- Adds new arguments
sort
andoffset
for~weaviate.data.DataObject.get
.
This minor version includes:
- Improves error message for error
"413: Payload Too Large"
-
Adds new
~weaviate.client.Client
credential OIDC flow method:client_credentials_config = weaviate.AuthClientCredentials( client_secret = "client_secret", scope = "scope1 scope2" # optional, depends on the configuration of your identity provider ) client = weaviate.Client("https://localhost:8080", auth_client_secret=client_credentials_config)
- Improves size of batches on dynamic batching.
- New
limit
argument to~weaviate.data.DataObject.get
method of the~weaviate.data.DataObject
client attribute. - Bump minimum version of request to
2.28.0
-
Adds support for
node_name
andconsistency_level
for both~weaviate.data.DataObject.get
and~weaviate.data.DataObject.get_by_id
of the~weaviate.data.DataObject
client attribute. This can be used ONLY with Weaviate Serverv1.17.0
or later. -
Adds support for replication factor in schema. This can be used ONLY with Weaviate Server
v1.17.0
or later. This can be configured in class schema like this:my_class = { "class": "MyClass", ..., "replicationConfig": { "factor": 1 } }
- Adds support for
Bm25
forGet
queries,~weaviate.gql.get.GetBuilder.with_bm25
. This can be used ONLY with Weaviate Serverv1.17.0
or later. - Adds support for
with_hybrid
forGet
queries,~weaviate.gql.get.GetBuilder.with_hybrid
. This can be used ONLY with Weaviate Serverv1.17.0
or later.
This minor version includes:
- Authentication using Bearer token, by adding
additional_headers
to the~weaviate.client.Client
initialization: client = weaviate.Client( url='http://localhost:8080', additional_headers={ {"authorization": "Bearer <MY_TOKEN>"} } )
- Authentication using Bearer token, by adding
- Multi-threading
~weaviate.batch.Batch
import: -
Now it is possible to import data using multi-threading. The number of threads can be set using the new argument
num_workers
in~weaviate.batch.Batch.configure
and~weaviate.batch.Batch.__call__
, defaults to 1 ( Use with care to not overload your weaviate instance.). -
New argument
connection_error_retries
to retry onConnectionError
that can be set in~weaviate.batch.Batch.configure
and~weaviate.batch.Batch.__call__
or using the property getter/setter:client.batch.connection_error_retries
to get the value andclient.batch.connection_error_retries = 5
to set the value. -
New method
~weaviate.batch.Batch.start
to create aBatchExecutor
(ThreadExecutor
). This method does NOT need to be called if using the~weaviate.batch.Batch
in a context manager (with
). Also it is idempotent. -
New method
~weaviate.batch.Batch.shutdown
to shutdown the existingBatchExecutor
(ThreadExecutor
) to release any resources that it is holding once the batch import is done. This method does NOT need to be called if using the~weaviate.batch.Batch
in a context manager (with
). Also it is idempotent.
-
- Multi-threading
- New
~weaviate.client.Client
attribute~weaviate.cluster.Cluster
to check the status of the cluster nodes. - The method
~weaviate.cluster.Cluster.get_nodes_status
returns the status of each node as a list of dictionaries. client.cluster.get_nodes_status()
- The method
- New
- Fix for
~weaviate.data.DataObject.replace
and~weaviate.data.DataObject.update
when using with Weaviate server>=v1.14.0
. - New default
timeout_config
:(10, 60)
.
This minor version includes:
- Backup functionalities (
~weaviate.backup.Backup
): ~weaviate.backup.Backup.create
method to create backups (all/subset of classes).~weaviate.backup.Backup.get_create_status
method to get the status of the created backup.~weaviate.backup.Backup.restore
method to restore Weaviate from a backup (all/subset of classes).~weaviate.backup.Backup.get_restore_status
method to get the status of the restored backup.
- Backup functionalities (
- New
~weaviate.Client
attribute:backup
tocreate
,restore
andget status
of the backups. All backup operations MUST be done throughClient.backup
. - Added return value for
~weaviate.batch.Batch.add_data_object
, it now returns the UUID of the added object, if one was not set then an UUIDv4 will be generated.
This minor version includes:
- Adds rolling average (last 5 batches) for batch creation time used by Dynamic Batching method.
- Adds ability to use
~weaviate.gql.Query.get
without specifying any properties IF Additional Properties (~weaviate.gql.get.GetBuilder.with_additional
) are set before executing the query. - Adds base Weaviate Exception
~weaviate.exceptions.WeaviateBaseError
. - Adds ability to set proxies. Can be set at
~weaviate.client.Client
initialization by using the newproxies
ortrust_env
arguments. ~weaviate.batch.crud_batch.Batch
creates UUIDs (UUIDv4) for all added objects that do not have one at client side (fixes data duplication on Batch retries).- Adds new methods for
~weaviate.wcs.WCS
for instances that have authentication enabled: ~weaviate.wcs.WCS.get_users_of_cluster
to get users (emails) for all the users that have access to the created Weaviate instance.~weaviate.wcs.WCS.add_user_to_cluster
to add users (email) to the created Weaviate instance.~weaviate.wcs.WCS.remove_user_from_cluster
to remove user (email) from the created Weaviate instance.
- Adds new methods for
This minor version includes:
- New function in
~weaviate.util.check_batch_result
used to print errors from batch creation. - New function argument
class_name
for~weaviate.util.generate_local_beacon
, used ONLY with Weaviate Server version >=1.14.0
(defaults to
None
for backwards compatibility).
- New function argument
~weaviate.util.check_batch_result
is the defaultcallback
function for~weaviate.batch.Batch
(~weaviate.batch.Batch.configure
and~weaviate.batch.Batch.__call__
) (instead ofNone
).- New method argument
to_object_class_name
for~weaviate.batch.Batch.add_reference
, used ONLY with Weaviate Server version >=1.14.0
(defaults toNone
for backwards compatibility). - Support for
distance
in GraphQL filters (only with Weaviate server >=1.14.0
). - For
~weaviate.data.DataObject
: - New method argument
class_name
for~weaviate.data.DataObject.get_by_id
,~weaviate.data.DataObject.get
,~weaviate.data.DataObject.delete
~weaviate.data.DataObject.exists
, used ONLY with Weaviate Server version >=1.14.0
(defaults toNone
for backwards compatibility). - Deprecation Warning if Weaviate Server version >= 1.14.0 and
class_name
isNone
OR if Weaviate Server version < 1.14.0 andclass_name
is NOTNone
.
- For
- For
~weaviate.data.references.Reference
: - New method arguments
from_class_name
andto_class_name
(to_class_names
for~weaviate.data.references.Reference.update
) for~weaviate.data.references.Reference.add
,~weaviate.data.references.Reference.delete
,~weaviate.data.references.Reference.update
, used ONLY with Weaviate Server version >=1.14.0
(defaults toNone
for backwards compatibility). - Deprecation Warning if Weaviate Server version >= 1.14.0 and
class_name
isNone
OR if Weaviate Server version < 1.14.0 andclass_name
is NOTNone
.
- For
This patch version fixes:
- the rerank not being set bug in
~weaviate.gql.get.GetBuilder.with_ask
. - the bug when using double quotes(") in question field in
~weaviate.gql.get.GetBuilder.with_ask
. - the bug where nearText filter checks for objects in moveXXX clause but never sets it.
This minor version contains functionality for the new features introduced in Weaviate v1.13.0
.
- New
~weaviate.batch.Batch
method~weaviate.batch.Batch.delete_objects
to delete all objects that match a particular expression (where
filter). - New
~weaviate.gql.get.GetBuilder
method~weaviate.gql.get.GetBuilder.with_sort
that allows sorting data on a particular field/s. - New
~weaviate.gql.aggregate.AggregateBuilder
method~weaviate.gql.aggregate.AggregateBuilder.with_near_text
that allows to aggregate data that is matchingnearText
filter. - New
~weaviate.gql.aggregate.AggregateBuilder
method~weaviate.gql.aggregate.AggregateBuilder.with_near_object
that allows to aggregate data that is matchingnearObject
filter. - New
~weaviate.gql.aggregate.AggregateBuilder
method~weaviate.gql.aggregate.AggregateBuilder.with_near_vector
that allows to aggregate data that is matchingnearVector
filter.
~weaviate.data.DataObject.exists
.~weaviate.data.DataObject.exists
.invertedIndexConfig
field.~weaviate.schema.Schema.get_class_shards
to get all shards configuration of a particular class.~weaviate.schema.Schema.update_class_shard
to update one/all shard/s configuration of a particular class.tokenization
.~weaviate.data.DataObject
too i.e. UUIDs without hyphens.~weaviate.gql.get.GetBuilder.with_offset
for the Get
queries. This method should be used with the ~weaviate.gql.get.GetBuilder.with_limit
. This new feature (introduced in weaviate version 1.8.0
) allows to use pagination functionality with the Get
queries. The offset
represents the start index of the objects to be returned, and the number of objects is specified by the ~weaviate.gql.get.GetBuilder.with_limit
method.limit: 10
. Then, to "display the second page of 10", set offset: 10, limit: 10
and so on. E.g. to show the 9th page of 10 results, set offset: 80, limit: 10
to effectively display results 81-90.This patch fixes the 'Batch' object is not callable
error.
class_name
and cross-refs dataType
are implicitly capitalized. (This functionality is added because if class_name
is not capitalized then Weaviate server does it for you, and this was leading to errors where the client and server have different configurations.)Fixes/updates in ~weaviate.schema.Schema
class:
- This patch fixes the
~weaviate.schema.Schema.contains
to accept separate class schemas as argument i.e. it does not expect to have only this format:{"classes": [CLASS_1, CLASS_2, ...]}
; now it is possible to pass justCLASS_X
as well.
This patch fixes the ~weaviate.gql.get.GetBuilder.with_near_object
. It uses now explicit string literals for id
/beacon
in nearoOject clauses.
This patch adds support for array data types: boolean[]
, date[]
.
This patch adds support for array data types: int[]
, number[]
, text[]
, string[]
.
Fixes/updates in ~weaviate.wcs.WCS
class:
- Fixed progress bar for
~weaviate.wcs.WCS.create
, it is being updated in Notebooks too, instead of printing each iteration on new line. - Method
~weaviate.wcs.WCS.create
now prints the creation status above the bar.
Updates in ~weaviate.gql
sub-package:
- New key-value
autocorrect: <bool>
introduced for the~weaviate.gql.filter.NearText
and~weaviate.gql.filter.Ask
filters. Theautocorrect
is enabled only if Weaviate server has thetext-spellcheck
module enabled. Ifautocorrect
isTrue
the query is corrected before the query is made. Usage example:
# with 'nearText' filter
client.query\
.get('Article', ['title', 'author'])\
.near_text(
{
'concepts': ['Ecconomy'],
'autocorrect': True
}
)
# the concept should be corrected to 'Economy'
# with 'ask' filter
client.query\
.get('Article', ['title', 'author'])\
.with_ask(
{
'question': 'When was the last financial crysis?',
'autocorrect': True
}
)
# the question should be corrected to 'When was the last financial crisis?'
- New method
~weaviate.gql.get.GetBuilder.with_additional
is added to GET the _additional properties. Usage example:
# single additional property with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
id
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional('id') # argument as `str`
# multiple additional property with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
id
certainty
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional(['id', 'certainty']) # argument as `List[str]`
# additional properties as clause with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
classification {
basedOn
classifiedFields
completed
id
scope
}
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional(
{
'classification' : [
'basedOn',
'classifiedFields',
'completed',
'id',
'scope'
]
}
) # argument as `Dict[str, List[str]]`
# or with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
classification {
completed
}
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional(
{
'classification' : 'completed'
}
) # argument as `Dict[str, str]`
# additional properties as clause and clause settings with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
token (
properties: ["content"]
limit: 10
certainty: 0.8
) {
certainty
endPosition
entity
property
startPosition
word
}
}
}
}
}
'''
clause = {
'token': [
'certainty',
'endPosition',
'entity',
'property',
'startPosition',
'word',
]
}
settings = {
'properties': ["content"], # is required
'limit': 10, # optional, int
'certainty': 0.8 # optional, float
}
client.query\
.get('Article', ['title', 'author'])\
.with_additional(
(clause, settings)
) # argument as `Tuple[Dict[str, List[str]], Dict[str, Any]]`
# if the desired clause does not match any example above, then the clause can always
# be converted to string before passing it to the `.with_additional` method
- Fixes in
~weaviate.wcs.WCS
class: - Make
~weaviate.wcs.WCS
's methods' argumentcluster_name
case insensitive (lowercased inside the method) to match Weaviate Cloud Service' naming convention, this fixes the error when Weaviate Cloud Service lowercases thecluster_name
but the users are not aware of this and get the exception KeyError.
- Fixes in
- New
~weaviate.batch.Batch
methods: ~weaviate.batch.Batch.pop_object
/~weaviate.batch.Batch.pop_reference
to remove and return an added object/reference from the~weaviate.batch.Batch
at positionindex
(by default-1
).~weaviate.batch.Batch.empty_objects
/~weaviate.batch.Batch.empty_references
to remove all the existing objects/references from the~weaviate.batch.Batch
instance.~weaviate.batch.Batch.is_empty_objects
/~weaviate.batch.Batch.is_empty_references
to check there are any objects/references in the~weaviate.batch.Batch
instance.
- New
- Fixes in
~weaviate.wcs.WCS
class: - Authentication only with
~weaviate.auth.AuthClientPassword
. - The
~weaviate.wcs.WCS.create
argumentmodule
is renamed tomodules
and can also be a list of modules to enable for the WCS cluster. The argument can be used on the PROD WCS too. - The
~weaviate.wcs.WCS.get_cluster_config
does not raise an exception if the cluster does not exist but returns a empty configuration. - The
~weaviate.wcs.WCS.delete_cluster
does not raise an exception if the cluster does not exist.
- Authentication only with
- Fixes in
- Add
phoneNumber
to the Weaviate's primitive types. Thanks to GitHub user @cdpierse. - Bug fix in
~weaviate.connect.Connection
. - Fix
ConnectionError
handling. - Optimization in
weaviate.batch.requests
andweaviate.connect.connection
.
weaviate.tools
module is REMOVED.Batcher
class is REMOVED.WCS
class is moved from theweaviate.tools
to the new moduleweaviate.wcs
weaviate.tools.generate_uuid
is REMOVED.
weaviate.util.generate_uuid5
is ADDED.- New
~weaviate.batch.Batch
class implementation to replace the old one. This implementation uses theBatchRequest
objects under the hood, which means that there is no need to createBatchRequest
's anymore. This new class implementation allows 3 different batch creations methods: manual, auto-create and auto-create with dynamic batching. See the~weaviate.batch.Batch
documentation for more information. BatchRequest
classes (ObjectsBatchRequest
andReferenceBatchRequest
) are hidden from the user and should not be used anymore. This is due to the new~weaviate.batch.Batch
class implementation.- New
~weaviate.schema.Schema
field is ADDED, "shardingConfig". It can bu used with Weaviate version >= 1.6.0. - New method
~weaviate.schema.Schema.update_config
used to update mutable schema configuration (like efConstruction, ...).