Skip to content

Commit 2e87f84

Browse files
authored
Merge pull request #445 from miurla/feat/disable-chat-history
fix: add env flag to disable chat history saving
2 parents dd231d0 + 78cc3a8 commit 2e87f84

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/streaming/handle-stream-finish.ts

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export async function handleStreamFinish({
6464
...responseMessages.slice(-1)
6565
] as ExtendedCoreMessage[]
6666

67+
if (process.env.NEXT_PUBLIC_ENABLE_SAVE_CHAT_HISTORY !== 'true') {
68+
return
69+
}
70+
6771
// Get the chat from the database if it exists, otherwise create a new one
6872
const savedChat = (await getChat(chatId)) ?? {
6973
messages: [],

0 commit comments

Comments
 (0)