feat: improve AI Chat UX, add notebook summary, and fix shared/reminders routing
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m50s
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m50s
This commit is contained in:
@@ -273,22 +273,21 @@ Focus ONLY on this note unless asked otherwise.`
|
||||
|
||||
const provider = getChatProvider(sysConfig)
|
||||
const result = await streamText({
|
||||
model: provider.chatModel,
|
||||
model: provider.getModel(),
|
||||
system: systemPrompt,
|
||||
messages: incomingMessages,
|
||||
tools: chatTools,
|
||||
maxSteps: 5,
|
||||
onFinish: async (final) => {
|
||||
// Save messages to DB
|
||||
const userContent = incomingMessages[incomingMessages.length - 1].content
|
||||
await prisma.message.create({
|
||||
await prisma.chatMessage.create({
|
||||
data: { conversationId: conversation.id, role: 'user', content: userContent }
|
||||
})
|
||||
await prisma.message.create({
|
||||
await prisma.chatMessage.create({
|
||||
data: { conversationId: conversation.id, role: 'assistant', content: final.text }
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return result.toDataStreamResponse()
|
||||
return result.toUIMessageStreamResponse()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user