Releases: weaviate/weaviate-python-client
Weaviate python client compatible with Weaviate v1.4.x
Changelog: weaviate-python-client v2.5.x
The new version is compatible with Weaviate v1.4.0
.
weaviate.gql.get.GetBuilder
- New method
with_near_image(content: dict, encode: bool = True)
is added for the GET query. E.g.:
content = { "image": "IMAGE_PATH/image.png", "certainty": 0.7, } client.query.get("Article", "coverImage").with_near_image(content=content, encode=True).do()
weaviate.util
- New function
image_encoder_b64
to encode a image to base64, the argument is the image path OR the file object in"br"
mode.
weaviate.util.image_encoder_b64(
image_or_image_path: Union[str, BufferedReader]
) -> str
- New function
image_decoder_b64
to decode a image from base64 to bytes stream, the argument is the base64 encoded image string.
weaviate.util.image_decoder_b64(
encoded_image: str
) -> bytes
New features for QnA module and WCS cluster creation
Changelog: weaviate-python-client v2.4.x
The new version is compatible with Weaviate v1.3.0
.
- New method
with_ask
is added for the GET query. E.g.:
ask = { "question": "Who is the king of the Netherlands?", "certainty": 0.7, "properties": ["summary"] } client.query.get("Article", ["title", "_additional {hasAnswer certainty property result startPosition endPosition}"]).with_ask(ask).do()
- New
with_auth
argument forWCS.create
that enables/disables the authentication of the to be created Weaviate instance.
WCS.create(self,
cluster_name: str=None,
cluster_type: str='sandbox',
with_auth: bool=False, # <- NEW
module: Optional[Union[str, dict]]=None,
config: dict=None,
wait_for_completion: bool=True
) -> str
New features for WCS and Batcher, Removal of RDF
Changelog: weaviate-python-client v2.3.x
- Bug fixes.
- Fixes for some functions/methods docstrings.
- Updated dependences to newer versions.
weaviate.rdf
weaviate.rdf
was removed.
weaviate.tools
-
ADDED
Batcher.add
method to add either Data Objects or References, based on thekwargs
values. -
WCS.create
has a new argumentmodule
used to specify the module the weaviate should use. It is supported only for the DEV environment at the moment. -
WCS.create
shows a progress bar ifwait_for_complition
is set to True.
v2.2.0
Changelog: weaviate-python-client v2.2.x
weaviate.gql
- ADDED
NearObject
filter. - ADDED GetBuilder.
with_near_object(content: dict)
method.
weaviate.tools
- ADDED new Object
WCS
to create/delete WCS clusters from python.WCS(auth_client_secret: AuthCredentials, dev: bool=False)
dev
is for development URL.WCS.create(cluster_name: str=None, cluster_type: str='sandbox', config: dict=None, wait_for_completion: bool=True) -> str:
Create a cluster. Returns the cluster URL.WCS.is_ready(self, cluster_name: str) -> bool:
Check if cluster is created and ready to use.WCS.get_clusters(self, email: str) -> Optional[List[str]]:
Lists all weaviate clusters registerd with theemail
.WCS.get_cluster_config(self, cluster_name: str) -> dict:
Get details of a cluster.WCS.delete(self, cluster_name: str) -> None:
Delete the WCS instance.
v2.1.0
Changelog: weaviate-python-client v2.1.x
__version__
global variable is introduced.
weaviate.util
- get_valid_uuid(...) raises
ValueError
instead of returningNone
. - get_vector(vector: Sequence) -> list; is ADDED.
Get weaviate compatible format of the embedding vector. - get_uuid_from_weaviate_url is REMOVED because get_valid_uuid implements it.
- _get_valid_timeout_config(timeout_config: Union[Tuple[int, int], List[int]]) is ADDED.
Validate and return TimeOut configuration.
weaviate.client_config
- ClientConfig class is REMOVED.
weaviate.client
- Client._init_(..., client_config: ClientConfig=None) -> Client._init_(..., timeout_config: Optional[Tuple[int, int]]=None)
Due to removal of ClientConfig. - ADDED setter/getter for Client.timeout_config.
weaviate.data.references
- _validate_and_get_uuid() is REMOVED.
weaviate.data
- DataObject.create(..., vector_weights: dict[str]=None) -> DataObject.create(..., vector: Sequence=None).
- DataObject.merge(...) -> DataObject.update(..., vector: Sequence=None).
- DataObject.update(...) -> DataObject.replace(..., vector: Sequence=None).
- DataObject.validate(...) -> DataObject.validate(..., vector: Sequence=None).
- DataObject.get(...) -> DataObject.get(..., uuid: str=None).
Nowget
can act as DataObject.get_by_id(...) too. - DataObject._get_object_response() is REMOVED.
weaviate.connect
- ADDED setter/getter for Connection.timeout_config.
weaviate.batch
- Batch.add_references() is REMOVED.
- BatchRequest._len_() is ADDED.
- BatchRequest.add() is ADDED.
- ReferenceBatchRequest.add_reference() is REMOVED.
- ObjectsBatchRequest.add(...) -> ObjectsBatchRequest.add(..., vector: Sequence=None)
- ObjectsBatchRequest.add_object() is REMOVED.
weaviate python client compatible with weaviate v1.x.x
Changelog: weaviate-python-client v2.0.x
weaviate.batch
-
Batch.create_things() -> Batch.create_objects() (or Batch.create() )
Due to removal of semantic kind (“things/actions”). -
Batch.create_actions() -> Batch.create_objects() (or Batch.create() )
Due to removal of semantic kind (“things/actions”). -
Batch.add_reference() is DEPRECATED -> Batch.create_references() (or Batch.create())
Deprecated to make the name consistent with object creation method. -
Batch.create() ADDED
This method creates eitherobjects
orreferences
. -
ReferenceBatchRequest.get_batch_size() REMOVED
Uselen(<ReferenceBatchRequest>)
. -
ReferenceBatchRequest.get_reference() DEPRECATED -> ReferenceBatchRequest.add()
Due to redundancy on name level. -
ActionsBatchReference -> ObjectsBatchRequest
Due to removal of semantic kind (“things/actions”). -
ThingsBatchReference -> ObjectsBatchRequest
Due to removal of semantic kind (“things/actions”). -
ObjectsBatchRequest.get_objects() DEPRECATED -> ObjectsBatchRequest.add()
Due to redundancy on name level.
weaviate.classification
-
Classification.schedule.with_settings() ADDED
Set additional settings for your classification. -
SOURCE_WHERE_FILTER, TRAINING_SET_WHERE_FILTER, TARGET_WHERE_FILTER global variables were REMOVED.
These global variables were not used anywhere.
weaviate.data.references
-
Reference.delete(..., from_semantic_type, to_semantic_type) arguments were REMOVED.
Due to removal of semantic kind (“things/actions”). -
Reference.update(..., from_semantic_type, to_semantic_type) arguments were REMOVED.
Due to removal of semantic kind (“things/actions”). -
Reference.add(..., from_semantic_type, to_semantic_type) arguments were REMOVED.
Due to removal of semantic kind (“things/actions”).
weaviate.data
-
DataObject.create(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
DataObject.merge(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
DataObject.update(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
DataObject.get_by_id(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
DataObject.get_by_id(..., underscore_properties) -> DataObject.get_by_id(..., additional_properties).
All underscore properties are now clustered into a single fieldadditional
. -
DataObject.get(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
DataObject.get(..., underscore_properties) -> DataObject.get(..., additional_properties).
All underscore properties are now clustered into a single fieldadditional
. -
DataObject.delete(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
DataObject.exists(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
DataObject.validate(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”).
weaviate.gql
-
Query.METHOD .thing(...).with_XXX() -> Query.METHOD(...).with_XXX()
Due to removal of semantic kind (“things/actions”). -
Query.METHOD .action(...).with_XXX() -> Query.METHOD(...).with_XXX()
Due to removal of semantic kind (“things/actions”). -
build.Builder -> get.GetBuilder
The module and the class was renamed to reflect the GraphQL functionality. -
get.GetBuilder.with_explore() -> get.GetBuilder.with_near_text() [this means that it can be accessed as Query.get(...).with_near_text()]
Due to the renaming of explore to nearText. -
get.GetBuilder.with_near_vector() is ADDED [this means that it can be accessed as Query.get(...).with_near_vector()]
Due to the addition of a new method nearVector. -
filter.Explore -> filter.NearText
Due to the renaming of explore to nearText. -
filter.NearVector is ADDED
Due to the addition of a new method nearVector.
weaviate.schema.properties
- Property.create(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”).
weaviate.schema
-
Schema.create_class(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
Schema.delete_class(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”).
weaviate.tools
-
Batcher.add_data_object(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
Batcher.add_reference(..., from_semantic_type, to_semantic_type) arguments were REMOVED.
Due to removal of semantic kind (“things/actions”). -
Batcher.add_reference(from_thing_class_name, from_thing_uuid, to_thing_uuid, ...) -> Batcher.add_reference(from_object_class_name, from_object_uuid, to_object_uuid, ...).
Due to removal of semantic kind (“things/actions”).
weaviate.exceptions
- ThingAlreadyExistsException -> ObjectAlreadyExistsException.
Due to removal of semantic kind (“things/actions”).
weaviate.util
-
generate_local_beacon(..., semantic_type) argument was REMOVED.
Due to removal of semantic kind (“things/actions”). -
is_weaviate_entity_url -> is_weaviate_object_url.
Due to removal of semantic kind (“things/actions”). -
ParsedUUID was REMOVED.
Was used only to check if UUID is valid and return it, now theget_valid_uuid
can be used instead -
is_semantic_type was REMOVED.
Due to removal of semantic kind (“things/actions”). -
get_valid_uuid was ADDED.
Replacement for the ParsedUUID class.
1.0.0 Full implementation of weaviate API
This release contains the first full implementation of the weaviate API.
The client workflow follows the REST API workflow.
Full documentation can be found on the website.
Add get_all underscore properties and fix issues with package
get_all semantic types is now available.
meta has been replaced with the newer underscore properties.
The last pre release missed a package declaration in the setup.py which resulted in an error if the source of the package was not in the python path. This got fixed.