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 python binding for vectorstore #573

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

diksipav
Copy link
Contributor

@diksipav diksipav commented Jan 30, 2025

Metadata filter should be further developed and tested. The castings are not correct in some cases, I don't have knowledge atm to anticipate all possible use cases for metadata filtering. I left comments where things should be further updated/developed.

@diksipav diksipav marked this pull request as ready for review January 31, 2025 13:29
@diksipav diksipav requested a review from anbuzin January 31, 2025 13:29
@diksipav diksipav requested review from elprans and fantix February 10, 2025 17:44
@diksipav diksipav requested a review from 1st1 February 18, 2025 16:04
@diksipav diksipav changed the title Add MetadataFilter class & functionality Add python binding for vectorstore Feb 19, 2025
@diksipav diksipav changed the base branch from vectorstore to master February 19, 2025 20:53
@edgedb-cla
Copy link

edgedb-cla bot commented Feb 19, 2025

All commit authors signed the Contributor License Agreement.
CLA signed

Comment on lines 147 to 149
# Mark which fields were actually passed by the user (ignore 'id').
# So if user calls Record(id=..., text=None), "text" will appear here.
object.__setattr__(self, "_explicitly_set_fields", set(kwargs.keys()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be done by wrapping the constructor with a Python function.

Record(
id=result.id,
text=result.text,
embedding=result.embedding and list(result.embedding),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why wrapping with list() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I had some type inconsistence, will see what happens after I update things

id=result.id,
text=result.text,
embedding=result.embedding and list(result.embedding),
metadata=(json.loads(result.metadata)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. result.metadata can be None
  2. redundant parentheses

metadata := <json>$metadata,
}
select (
insert {{record_type}} {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Composing EdgeQL like this would need quoting, see edb.edgeql.quote.quote_ident() in the server code.

@diksipav diksipav marked this pull request as draft February 22, 2025 17:07
@diksipav diksipav marked this pull request as ready for review March 3, 2025 14:05
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

Successfully merging this pull request may close these issues.

4 participants