-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathprisma-client.ts
42 lines (31 loc) · 1.06 KB
/
prisma-client.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { PrismaClient, Prisma, Photo } from '@prisma/client';
// import { PrismaVectorStore } from "@langchain/community/vectorstores/prisma";
// import { GoogleGenerativeAIEmbeddings } from "@langchain/google-genai";
const prismaClientSingleton = () => {
return new PrismaClient();
};
declare global {
var prisma: undefined | ReturnType<typeof prismaClientSingleton>;
}
const prisma = globalThis.prisma ?? prismaClientSingleton();
if (process.env.NODE_ENV !== 'production') globalThis.prisma = prisma;
// export const photoStore = PrismaVectorStore.withModel<Photo>(prisma).create(
// new GoogleGenerativeAIEmbeddings(),
// {
// prisma: Prisma,
// tableName: "Photo",
// vectorColumnName: "vector",
// columns: {
// contentType: PrismaVectorStore.ContentColumn,
// id: PrismaVectorStore.IdColumn,
// location: PrismaVectorStore.ContentColumn,
// caption: PrismaVectorStore.ContentColumn,
// },
// filter: {
// origin: {
// equals: "tripPlanId",
// },
// },
// }
// );
export default prisma;