mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat: basic api server
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"studio": "drizzle-kit studio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@memohome/shared": "workspace:*",
|
||||
"dotenv": "^17.2.3",
|
||||
"drizzle-orm": "^0.45.1",
|
||||
"pg": "^8.16.3"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Model } from '@memohome/shared'
|
||||
import { jsonb, pgTable, uuid } from 'drizzle-orm/pg-core'
|
||||
|
||||
export const model = pgTable('model', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
model: jsonb('model').notNull().$type<Model>(),
|
||||
})
|
||||
@@ -1 +1,3 @@
|
||||
export * from './history'
|
||||
export * from './history'
|
||||
export * from './model'
|
||||
export * from './settings'
|
||||
@@ -0,0 +1,9 @@
|
||||
import { pgTable, text, uuid } from 'drizzle-orm/pg-core'
|
||||
import { model } from './model'
|
||||
|
||||
export const settings = pgTable('settings', {
|
||||
userId: text('user_id').primaryKey(),
|
||||
defaultChatModel: uuid('default_chat_model').references(() => model.id),
|
||||
defaultEmbeddingModel: uuid('default_embedding_model').references(() => model.id),
|
||||
defaultSummaryModel: uuid('default_summary_model').references(() => model.id),
|
||||
})
|
||||
Reference in New Issue
Block a user