Spaces:
Sleeping
Sleeping
Download src/libs/shared/infrastructure/postgres/schema/embeddings.ts from fouadkhalid123/asd: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/infrastructure/postgres/schema/embeddings.ts
- Command line
-
hf download hf://spaces/fouadkhalid123/asd/src/libs/shared/infrastructure/postgres/schema/embeddings.ts
-
curl -L -o embeddings.ts https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/infrastructure/postgres/schema/embeddings.ts
1.08 kB
| import { pgTable, uuid, text, timestamp, index, vector } from "drizzle-orm/pg-core"; | |
| import { stores } from "../../../../../modules/shopify/infrastructure/postgres/schema/stores"; | |
| export const embeddings = pgTable("embeddings", { | |
| id: uuid("id").primaryKey().defaultRandom(), | |
| storeId: uuid("store_id").notNull().references(() => stores.id, { onDelete: "cascade" }), | |
| documentId: text("document_id").notNull(), | |
| chunkId: text("chunk_id").notNull(), | |
| text: text("text").notNull(), | |
| embedding: vector("embedding", { dimensions: 1536 }), // OpenAI standard | |
| model: text("model").notNull().default("text-embedding-3-small"), | |
| metadata: text("metadata"), // JSON string or text info | |
| createdAt: timestamp("created_at").defaultNow().notNull(), | |
| }, (t) => ({ | |
| storeIdx: index("idx_embeddings_store").on(t.storeId), | |
| docIdx: index("idx_embeddings_doc").on(t.documentId), | |
| chunkIdx: index("idx_embeddings_chunk").on(t.chunkId), | |
| })); | |
| export type Embedding = typeof embeddings.$inferSelect; | |
| export type NewEmbedding = typeof embeddings.$inferInsert; | |