Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections v3 client #102

Merged
merged 376 commits into from
Jun 27, 2024
Merged

Collections v3 client #102

merged 376 commits into from
Jun 27, 2024

Conversation

tsmith023
Copy link
Collaborator

@tsmith023 tsmith023 commented Nov 24, 2023

This PR introduces the v3 collections client as a complete rewrite of the API surface to match the PYv4 client's new collections API. It makes use of all three (REST, GQL, gRPC) of Weaviate's APIs when offering its functionality. As such, there are several instances where this API depends on the builders of the previous API, especially when working with functionality that is only available through the REST or GQL APIs.

Key features added in this API are:

  • The .collections namespace within the client object from which all the new functionality is accessible, e.g. client.collections.get('MyCollection')
  • The Collection object within which exist several namespaces for accessing key core Weaviate functionality:
    • .aggregate for performing queries using the Aggregate /v1/graphql query
    • .backup for managing backups through the /v1/backups endpoint
    • .config for managing a collection's configuration through the /v1/schema endpoint
    • .data for managing a collection's data objects, e.g. CUD ops, through the /v1/objects endpoint, the weaviate.v1.weaviate.BatchObjects gRPC method (for .insertMany), and the weaviate.v1.weaviate.BatchDelete gRPC method (for .deleteMany)
    • .filter for defining fully generic filters for queries and .data.deleteMany that provides type safety given a user-provided generic
    • .generate for querying objects from a collection with generative capabilities through the weaviate.v1.weaviate.Search gRPC method
    • .metrics for defining fully generic metrics objects for aggregations that provides type safety given a user-provided generic
    • .query for querying objects from a collection without generative capabilities through the weaviate.v1.weaviate.Search gRPC method
    • .sort for defining fully generic sorting constraints for queries that provides type safety given a user-provided generic
    • .tenants for managing the tenants of a collection through /v1/tenants endpoint and the weaviate.v1.weaviate.TenantsGet gRPC method

The new API is also fully generic meaning that there are no instances of Record<string, Any> in the codebase (and if there are this is a mistake!). Users should have fine-grained control over the types they use when working with the API and will be able to define their own complex typing systems on top of the client.

@weaviate-git-bot
Copy link

Great to see you again! Thanks for the contribution.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

tsmith023 added 29 commits March 8, 2024 17:24
…y types, make generate required param of generate queries
@tsmith023 tsmith023 merged commit 565fb7f into main Jun 27, 2024
10 checks passed
@tsmith023 tsmith023 deleted the collections/main branch August 6, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants