- Replace creative/warm tone with factual summarization - Explicitly forbid invention, assumption, or hallucination - Model must ONLY use information from provided entries - Acknowledge gaps rather than fill them
102 lines
3.1 KiB
Plaintext
102 lines
3.1 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
email String @unique
|
|
passwordHash String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
apiKeys ApiKey[]
|
|
entries Entry[]
|
|
journals Journal[]
|
|
tasks Task[]
|
|
settings Settings?
|
|
}
|
|
|
|
model ApiKey {
|
|
id String @id @default(uuid())
|
|
userId String
|
|
keyHash String @unique
|
|
name String
|
|
lastUsedAt DateTime?
|
|
createdAt DateTime @default(now())
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([userId])
|
|
}
|
|
|
|
model Entry {
|
|
id String @id @default(uuid())
|
|
userId String
|
|
date String
|
|
type String
|
|
content String
|
|
mediaPath String?
|
|
metadata String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([userId, date])
|
|
@@index([date])
|
|
}
|
|
|
|
model Journal {
|
|
id String @id @default(uuid())
|
|
userId String
|
|
date String
|
|
content String
|
|
entryCount Int
|
|
generatedAt DateTime @default(now())
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
tasks Task[]
|
|
|
|
@@unique([userId, date])
|
|
@@index([userId])
|
|
}
|
|
|
|
model Task {
|
|
id String @id @default(uuid())
|
|
userId String
|
|
journalId String
|
|
type String @default("journal_generate")
|
|
status String @default("pending")
|
|
provider String
|
|
model String?
|
|
prompt String
|
|
request String?
|
|
response String?
|
|
error String?
|
|
createdAt DateTime @default(now())
|
|
completedAt DateTime?
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
journal Journal @relation(fields: [journalId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([userId])
|
|
@@index([journalId])
|
|
}
|
|
|
|
model Settings {
|
|
userId String @id
|
|
aiProvider String @default("openai")
|
|
aiApiKey String?
|
|
aiModel String @default("gpt-4")
|
|
aiBaseUrl String?
|
|
journalPrompt String @default("You are a factual diary summarizer. Your ONLY job is to summarize the entries provided to you - nothing more.\n\nCRITICAL RULES:\n1. ONLY use information explicitly stated in the entries below\n2. NEVER invent, assume, or hallucinate any detail not in the entries\n3. NEVER add activities, emotions, weather, or context not directly mentioned\n4. If something is unclear in the entries, simply state what IS clear\n5. Keep the summary grounded and factual - no embellishment\n6. Do not write in an overly creative or story-telling style\n7. Only reference what the user explicitly recorded\n\nStructure:\n- Start with what was recorded (meetings, tasks, activities)\n- Note any explicit feelings or observations mentioned\n- Keep it concise and factual\n- If there are gaps in the day, acknowledge only what was recorded")
|
|
language String @default("en")
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
}
|