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

Add UUID auto-id #505

Closed
davidmezzetti opened this issue Jul 10, 2023 · 0 comments
Closed

Add UUID auto-id #505

davidmezzetti opened this issue Jul 10, 2023 · 0 comments
Assignees
Milestone

Comments

@davidmezzetti
Copy link
Member

#502 added the ability to generate auto-id's when not otherwise provided at index time. This change will enable generating UUIDs via the autoid parameter. The logic should support any of the UUID functions available to generate random and deterministic UUIDs.

For example:

from txtai.embeddings import Embeddings

embeddings = Embeddings()
embeddings.index(["test"])

Currently creates an entry as (0, "test", None).

and with this change:

from txtai.embeddings import Embeddings

embeddings = Embeddings(autoid="uuid4")
embeddings.index(["test"])

Will instead create this entry as ("aa108dc5-442c-458a-8454-8c55f40af25d", "test", None).

The default method when not specified will continue to be a numeric sequence.

@davidmezzetti davidmezzetti added this to the v5.6.0 milestone Jul 10, 2023
@davidmezzetti davidmezzetti self-assigned this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant