fix chat streaming + add "deleted" field to chats

This commit is contained in:
Emily
2024-12-13 15:07:34 +01:00
parent f358bb9bb6
commit 6307e09dc3
7 changed files with 36 additions and 26 deletions

View File

@@ -7,6 +7,7 @@ export type TAiChatSchema = {
status: string,
completed: boolean,
title: string,
deleted: boolean,
created_at: Date,
updated_at: Date
}
@@ -17,6 +18,7 @@ const AiChatSchema = new Schema<TAiChatSchema>({
completed: { type: Boolean },
messages: [{ _id: false, type: Schema.Types.Mixed }],
title: { type: String, required: true },
deleted: { type: Boolean, default: false },
created_at: { type: Date, default: () => Date.now() },
updated_at: { type: Date, default: () => Date.now() },
});