You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the work on this, @ankane and team! It's amazing to see more vector types and distance metrics being added continuously :) I am trying to insert a binary vector using SQLalchemy and my code looks like this:
I am then trying to insert embedding as a list[int] of 0s and 1s only. However, this raises the following error:
RepositoryError: An exception occurred: (psycopg.errors.DatatypeMismatch) column "embedding" is of type bit but expression is of type smallint[]
^
HINT: You will need to rewrite or cast the expression.
A similar approach works fine using a list[float] when inserting into an embedding of type pgvector.sqlalchemy.Vector.
My question is: which Python type do I need to cast embedding to before insertion?
Thanks for the help in advance!
The text was updated successfully, but these errors were encountered:
Hello,
Thanks for the work on this, @ankane and team! It's amazing to see more vector types and distance metrics being added continuously :) I am trying to insert a binary vector using SQLalchemy and my code looks like this:
I am then trying to insert
embedding
as alist[int]
of 0s and 1s only. However, this raises the following error:A similar approach works fine using a
list[float]
when inserting into an embedding of typepgvector.sqlalchemy.Vector
.My question is: which Python type do I need to cast
embedding
to before insertion?Thanks for the help in advance!
The text was updated successfully, but these errors were encountered: