Vector type needed for storing OpenAI embeddings #18220
-
Hello, Still a Prisma newbie and don't know a great deal about DBs TBH. I was wondering if it's possible create a column of the Vector type needed for storing OpenAI embeddings as described in this Supabase blog post but using my current neon database that supports pgvector. So I've added the extension to my neon database. create extension vector; And now would need to do the equivalent of the following via the Prisma Schema: create table documents (
id bigserial primary key,
content text,
embedding vector (1536)
); So my guess is that this Vector type isn't supported? What happens then if I have a type supported by the DB (PostgreSQL) but not by Prisma? How do I keep all that in sync? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
This should help:
|
Beta Was this translation helpful? Give feedback.
-
it should be |
Beta Was this translation helpful? Give feedback.
-
There is a complete prisma schema example using vector available here: https://github.com/vercel/examples/blob/main/storage/postgres-pgvector/prisma/schema.prisma |
Beta Was this translation helpful? Give feedback.
-
hey @pranavp10 did you get this working? if i do the following: i always get 1 as response (1 as type number) no matter if i already saved an embedding inside |
Beta Was this translation helpful? Give feedback.
This should help:
https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#:~:text=The%20Unsupported%20attribute%20allows%20you,(%22polygon%22)%20type.