v4.4b9
weaviate.connect_to_x
methods
The timeout
argument in now a part of the additional_config
argument. It takes the class weaviate.config.AdditionalConfig
as input.
All optional arguments to methods in the query
namespace now are enforced as keyword arguments.
There is now runtime logic for parsing query arguments enforcing the correct type.
Batch processingIntroduction of three distinct algorithms using different batching styles under-the-hood:
client.batch.dynamic()
client.batch.fixed_size()
client.batch.rate_limit()
client.batch.dynamic() as batch
is a drop-in replacement for the previous client.batch as batch
, which is now deprecated and will be removed on release.
with client.batch.dynamic() as batch:
...
is equivalent to:
with client.batch as batch:
...
client.batch.fixed_size() as batch
is a way to configure your batching algorithm to only use a fixed size.
with client.batch.dynamic() as batch:
...
is equivalent to:
client.batch.configure_fixed_size()
with client.batch as batch:
...
client.batch.rate_limit() as batch
is a new way to help avoid hitting third-party vectorization API rate limits. By specifying request_per_minute
in the rate_limit()
method, you can force the batching algorithm to send objects to Weaviate at the speed your third-party API is capable of processing objects.
These methods now return completely localized context managers. This means that failed_objects
and failed_references
of one batch won't be included in any subsequent calls.
Finally, if the background thread responsible for sending the batches raises an exception this is now re-raised in the main thread rather than silently erroring.
FiltersThe argument prop
in Filter.by_property
has been renamed to name
Ref counting is now achievable using Filter.by_ref_count(ref)
rather than Filter([ref])
v4.4b8
Reference filters
Reference filters have a simplified syntax. The new syntax looks like this:
Filter.by_ref("ref").by_property("target_property")
Changes in v4.4b7
Library imports
Importing directly from weaviate
is deprecated. Use import weaviate.classes as wvc
instead.
Starting in v4.4b7, you have to explicitly close your client connections. There are two ways to close client connections.
Use client.close()
to explicitly close your client connections.
import weaviate
client = weaviate.connect_to_local()
print(client.is_ready())
client.close()
Use a context manager to close client connections for you.
import weaviate
with weaviate.connect_to_local() as client:
print(client.is_ready())
Batch processing
The v4.4b7 client introduces changes to client.batch
.
client.batch
requires a context manager..create_objects
.batch.configure_fixed_size
to specify values.add_reference
method is updated.to_object_collection
method is removed.Updated client.batch
parameters
Filter syntax is updated in v4.4b7.
NOTE: The filter reference syntax is simplified in 4.4b8.
Old syntax New syntax in v4.4b7 Filter(path=property) Filter.by_property(property) Filter(path=["ref", "target_class", "target_property"]) Filter.by_ref().link_on("ref").by_property("target_property") FilterMetadata.ByXX Filter.by_id()The pre-4.4b7 filter syntax is deprecated. The new, v4.4b7 syntax looks like this.
import weaviate
import datetime
import weaviate.classes as wvc
client = weaviate.connect_to_local()
jeopardy = client.collections.get("JeopardyQuestion")
response = jeopardy.query.fetch_objects(
filters=wvc.query.Filter.by_property("round").equal("Double Jeopardy!") &
wvc.query.Filter.by_creation_time().greater_or_equal(datetime.datetime(2005, 1, 1)) |
wvc.query.Filter.by_creation_time().greater_or_equal(datetime.datetime(2000, 12, 31)),
limit=3
)
client.close()
reference_add_many
updated
The reference_add_many
syntax is updated; DataReferenceOneToMany
is now DataReference
.
collection.data.reference_add_many(
[
DataReference(
from_property="ref",
from_uuid=uuid_from,
to_uuid=*one or a list of UUIDs*,
)
]
)
References
Multi-target references updated. These are the new functions:
ReferenceProperty.MultiTarget
DataReference.MultiTarget
QueryReference.MultiTarget
Use ReferenceToMulti
for multi-target references.
references
parameter during collection creation, object insertion and queries.FromReference
class is now called QueryReference
.weaviate.classes
submodule further split into:
weaviate.classes.config
weaviate.classes.data
weaviate.classes.query
weaviate.classes.generic
vector_index_config
parameter factory functions for wvc.config.Configure
and wvc.config.Reconfigure
have changed to, e.g.:
client.collections.create(
name="MyCollection",
vector_index_config=wvc.config.Configure.VectorIndex.hnsw(
distance_metric=wvc.config.VectorDistances.COSINE,
vector_cache_max_objects=1000000,
quantizer=wvc.config.Configure.VectorIndex.Quantizer.pq()
),
)
vector_index_type
parameter has been removed.vectorize_class_name
parameter in the Property
constructor method is vectorize_collection_name
.[collection].data.update()
/ .replace()
*args order changed, aiming to accommodate not providing properties when updating.[collection].data.reference_add
/ .reference_delete
/ .reference_replace
the ref
keyword was renamed to to
.collections.create()
/ get()
: data_model
kwarg to keyword to provide generics was renamed to data_model_properties
.[object].metadata.uuid
is now [object].uuid
.[object].metadata.creation_time_unix
is now [object].metadata.creation_time
.[object].metadata.last_update_time_unix
is now [object].metadata.last_update
.quantitizer
is renamed to quantizer
include_vector
parameter.datetime
object, and the parameters are renamed to creation_time
and last_update_time
under MetadataQuery
.
metadata.creation_time.timestamp() * 1000
will return the same value as before.query.fetch_object_by_id()
now uses gRPC under the hood (rather than REST), and returns objects in the same format as other queries.UUID
and DATE
properties are returned as typed objects.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4