mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-28 20:04:26 +00:00
feat(chat): add AgentSessionType enum and filter chatbot history sessions
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "AgentSessionType" AS ENUM ('comment', 'chat');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "agent_sessions" ADD COLUMN "type" "AgentSessionType" NOT NULL DEFAULT 'comment';
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "agent_sessions_type_idx" ON "agent_sessions"("type");
|
||||
@@ -645,6 +645,11 @@ enum AgentType {
|
||||
embedding
|
||||
}
|
||||
|
||||
enum AgentSessionType {
|
||||
comment
|
||||
chat
|
||||
}
|
||||
|
||||
model Agent {
|
||||
id String @id
|
||||
user User @relation(fields: [id], references: [id], onDelete: Cascade)
|
||||
@@ -693,11 +698,13 @@ model AgentSession {
|
||||
assetId String? @map("asset_id")
|
||||
asset Asset? @relation("AssetToAgentSession", fields: [assetId], references: [id], onDelete: Cascade)
|
||||
userCommentId String? @map("user_comment_id")
|
||||
type AgentSessionType @default(comment)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
entries AgentSessionEntry[]
|
||||
comments AssetComment[]
|
||||
|
||||
@@index([type])
|
||||
@@map("agent_sessions")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user