anything-llm/server/prisma/schema.prisma
Sean Hatfield 1846a99b93
[FEAT] Embedded AnythingLLM (#656)
* WIP embedded app

* WIP got response from backend in embedded app

* WIP streaming prints to embedded app

* implemented streaming and tailwind min for styling into embedded app

* WIP embedded app history functional

* load params from script tag into embedded app

* rough in modularization of embed chat
cleanup dev process for easier dev support
move all chat to components
todo: build process
todo: backend support

* remove eslint config

* Implement models and cleanup embed chat endpoints
Improve build process for embed
prod minification and bundle size awareness
WIP

* forgot files

* rename to embed folder

* introduce chat modal styles

* add middleware validations on embed chat

* auto open param and default greeting

* reset chat history

* Admin embed config page

* Admin Embed Chats mgmt page

* update embed

* nonpriv

* more style support
reopen if chat was last opened

* update comments

* remove unused imports

* allow change of workspace for embedconfig

* update failure to lookup message

* update reset script

* update instructions

* Add more styling options
Add sponsor text at bottom
Support dynamic container height
Loading animations

* publish new embed script

* Add back syntax highlighting and keep bundle small via dynamic script build

* add hint

* update readme

* update copy model for snippet with link to styles

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-02-05 14:21:34 -08:00

171 lines
5.7 KiB
Plaintext

generator client {
provider = "prisma-client-js"
}
// Uncomment the following lines and comment out the SQLite datasource block above to use PostgreSQL
// Make sure to set the correct DATABASE_URL in your .env file
// After swapping run `yarn prisma:setup` from the root directory to migrate the database
//
// datasource db {
// provider = "postgresql"
// url = env("DATABASE_URL")
// }
datasource db {
provider = "sqlite"
url = "file:../storage/anythingllm.db"
}
model api_keys {
id Int @id @default(autoincrement())
secret String? @unique
createdBy Int?
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
}
model workspace_documents {
id Int @id @default(autoincrement())
docId String @unique
filename String
docpath String
workspaceId Int
metadata String?
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
workspace workspaces @relation(fields: [workspaceId], references: [id])
}
model invites {
id Int @id @default(autoincrement())
code String @unique
status String @default("pending")
claimedBy Int?
createdAt DateTime @default(now())
createdBy Int
lastUpdatedAt DateTime @default(now())
}
model system_settings {
id Int @id @default(autoincrement())
label String @unique
value String?
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
}
model users {
id Int @id @default(autoincrement())
username String? @unique
password String
pfpFilename String?
role String @default("default")
suspended Int @default(0)
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
workspace_chats workspace_chats[]
workspace_users workspace_users[]
embed_configs embed_configs[]
embed_chats embed_chats[]
}
model document_vectors {
id Int @id @default(autoincrement())
docId String
vectorId String
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
}
model welcome_messages {
id Int @id @default(autoincrement())
user String
response String
orderIndex Int?
createdAt DateTime @default(now())
}
model workspaces {
id Int @id @default(autoincrement())
name String
slug String @unique
vectorTag String?
createdAt DateTime @default(now())
openAiTemp Float?
openAiHistory Int @default(20)
lastUpdatedAt DateTime @default(now())
openAiPrompt String?
similarityThreshold Float? @default(0.25)
chatModel String?
topN Int? @default(4)
workspace_users workspace_users[]
documents workspace_documents[]
embed_configs embed_configs[]
}
model workspace_chats {
id Int @id @default(autoincrement())
workspaceId Int
prompt String
response String
include Boolean @default(true)
user_id Int?
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
users users? @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
}
model workspace_users {
id Int @id @default(autoincrement())
user_id Int
workspace_id Int
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
workspaces workspaces @relation(fields: [workspace_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
users users @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
}
model cache_data {
id Int @id @default(autoincrement())
name String
data String
belongsTo String?
byId Int?
expiresAt DateTime?
createdAt DateTime @default(now())
lastUpdatedAt DateTime @default(now())
}
model embed_configs {
id Int @id @default(autoincrement())
uuid String @unique
enabled Boolean @default(false)
chat_mode String @default("query")
allowlist_domains String?
allow_model_override Boolean @default(false)
allow_temperature_override Boolean @default(false)
allow_prompt_override Boolean @default(false)
max_chats_per_day Int?
max_chats_per_session Int?
workspace_id Int
createdBy Int?
usersId Int?
createdAt DateTime @default(now())
workspace workspaces @relation(fields: [workspace_id], references: [id], onDelete: Cascade)
embed_chats embed_chats[]
users users? @relation(fields: [usersId], references: [id])
}
model embed_chats {
id Int @id @default(autoincrement())
prompt String
response String
session_id String
include Boolean @default(true)
connection_information String?
embed_id Int
usersId Int?
createdAt DateTime @default(now())
embed_config embed_configs @relation(fields: [embed_id], references: [id], onDelete: Cascade)
users users? @relation(fields: [usersId], references: [id])
}