Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: return recent history

Marc Seitza77b81bbe26d
diff --git a/ee/features/ai/lib/chat/send-message.ts b/ee/features/ai/lib/chat/send-message.ts
index 6e2a54c0..98d4eac3 100644
--- a/ee/features/ai/lib/chat/send-message.ts
+++ b/ee/features/ai/lib/chat/send-message.ts
@@ -26,7 +26,7 @@ export async function sendMessage({
// Get conversation history from database
const history = await prisma.chatMessage.findMany({
where: { chatId },
- orderBy: { createdAt: "asc" },
+ orderBy: { createdAt: "desc" },
take: 10,
});