We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dd231d0 + 78cc3a8 commit 2e87f84Copy full SHA for 2e87f84
lib/streaming/handle-stream-finish.ts
@@ -64,6 +64,10 @@ export async function handleStreamFinish({
64
...responseMessages.slice(-1)
65
] as ExtendedCoreMessage[]
66
67
+ if (process.env.NEXT_PUBLIC_ENABLE_SAVE_CHAT_HISTORY !== 'true') {
68
+ return
69
+ }
70
+
71
// Get the chat from the database if it exists, otherwise create a new one
72
const savedChat = (await getChat(chatId)) ?? {
73
messages: [],
0 commit comments