- Conversation sidebar with create/delete/history - Chat area with streaming LLM responses (z-ai-web-dev-sdk) - Voice input via Web Speech API with recording indicator - Browser TTS auto-speak for assistant responses - Settings panel (voice, TTS, sidebar toggle) - Prisma schema: Conversation + Message models - API routes: /api/chat/stream, /api/conversations, /api/messages - Zustand store for state management - Web Speech API type declarations
38 lines
1.0 KiB
Plaintext
38 lines
1.0 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
email String @unique
|
|
name String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
conversations Conversation[]
|
|
}
|
|
|
|
model Conversation {
|
|
id String @id @default(cuid())
|
|
title String @default("New Conversation")
|
|
userId String?
|
|
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
|
|
messages Message[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Message {
|
|
id String @id @default(cuid())
|
|
role String // "user" | "assistant" | "system"
|
|
content String
|
|
audioUrl String?
|
|
conversationId String
|
|
conversation Conversation @relation(fields: [conversationId], references: [id], onDelete: Cascade)
|
|
createdAt DateTime @default(now())
|
|
}
|