mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
enh: temp chat
deprecates chat history setting and introduces temp chat from model selector
This commit is contained in:
@@ -26,7 +26,8 @@
|
||||
socket,
|
||||
showCallOverlay,
|
||||
tools,
|
||||
currentChatPage
|
||||
currentChatPage,
|
||||
temporaryChatEnabled
|
||||
} from '$lib/stores';
|
||||
import {
|
||||
convertMessagesToHistory,
|
||||
@@ -238,7 +239,7 @@
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!($settings.saveChatHistory ?? true)) {
|
||||
if ($temporaryChatEnabled) {
|
||||
await goto('/');
|
||||
}
|
||||
}
|
||||
@@ -414,7 +415,7 @@
|
||||
}
|
||||
|
||||
if ($chatId == chatId) {
|
||||
if ($settings.saveChatHistory ?? true) {
|
||||
if (!$temporaryChatEnabled) {
|
||||
chat = await updateChatById(localStorage.token, chatId, {
|
||||
models: selectedModels,
|
||||
messages: messages,
|
||||
@@ -462,7 +463,7 @@
|
||||
}
|
||||
|
||||
if ($chatId == chatId) {
|
||||
if ($settings.saveChatHistory ?? true) {
|
||||
if (!$temporaryChatEnabled) {
|
||||
chat = await updateChatById(localStorage.token, chatId, {
|
||||
models: selectedModels,
|
||||
messages: messages,
|
||||
@@ -620,7 +621,7 @@
|
||||
|
||||
// Create new chat if only one message in messages
|
||||
if (newChat && messages.length == 2) {
|
||||
if ($settings.saveChatHistory ?? true) {
|
||||
if (!$temporaryChatEnabled) {
|
||||
chat = await createNewChat(localStorage.token, {
|
||||
id: $chatId,
|
||||
title: $i18n.t('New Chat'),
|
||||
@@ -954,7 +955,7 @@
|
||||
}
|
||||
|
||||
if ($chatId == _chatId) {
|
||||
if ($settings.saveChatHistory ?? true) {
|
||||
if (!$temporaryChatEnabled) {
|
||||
chat = await updateChatById(localStorage.token, _chatId, {
|
||||
messages: messages,
|
||||
history: history,
|
||||
@@ -1227,7 +1228,7 @@
|
||||
}
|
||||
|
||||
if ($chatId == _chatId) {
|
||||
if ($settings.saveChatHistory ?? true) {
|
||||
if (!$temporaryChatEnabled) {
|
||||
chat = await updateChatById(localStorage.token, _chatId, {
|
||||
models: selectedModels,
|
||||
messages: messages,
|
||||
@@ -1400,7 +1401,7 @@
|
||||
title = _title;
|
||||
}
|
||||
|
||||
if ($settings.saveChatHistory ?? true) {
|
||||
if (!$temporaryChatEnabled) {
|
||||
chat = await updateChatById(localStorage.token, _chatId, { title: _title });
|
||||
|
||||
currentChatPage.set(1);
|
||||
|
||||
Reference in New Issue
Block a user