diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 4fbf0f8..f58e2f6 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -39,7 +39,7 @@ model Message { createdAt DateTime @default(now()) role Role - content String + content String @default("") session Session @relation(fields: [sessionId], references: [id]) sessionId String @db.ObjectId diff --git a/src/chat.js b/src/chat.js index c9a5b40..b832cda 100644 --- a/src/chat.js +++ b/src/chat.js @@ -36,7 +36,10 @@ export const chat = async (callId) => { for (let msg of msgs) { messages.push({ role: convertRole(msg.role), - content: msg.content, + content: + msg.content.length > 0 + ? msg.content + : "This message was not recorded correctly.", }); }