This commit is contained in:
Timothy Jaeryang Baek
2026-07-24 00:43:31 -04:00
parent 4e869011cd
commit 1e88367cc8
2 changed files with 12 additions and 2 deletions
+7
View File
@@ -1259,6 +1259,8 @@ async def update_chat_by_id(
)
chat = await Chats.update_chat_by_id(id, updated_chat, db=db)
if form_data.variables is not None:
chat = await Chats.update_chat_variables_by_id(id, form_data.variables, db=db) or chat
# Reconcile chat_message rows without inferring deletes from missing IDs.
# Message deletion has its own endpoint below.
@@ -1642,6 +1644,9 @@ async def fork_chat_by_id(
internal_meta=meta,
)
if fork and chat.variables:
fork = await Chats.update_chat_variables_by_id(fork.id, chat.variables, db=db, touch=False) or fork
if not fork:
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=ERROR_MESSAGES.DEFAULT())
@@ -1684,6 +1689,7 @@ async def clone_chat_by_id(
**{
'chat': updated_chat,
'meta': chat.meta,
'variables': chat.variables or {},
'pinned': chat.pinned,
'folder_id': chat.folder_id,
}
@@ -1767,6 +1773,7 @@ async def clone_shared_chat_by_id(
**{
'chat': updated_chat,
'meta': chat.meta,
'variables': chat.variables or {},
'pinned': chat.pinned,
'folder_id': chat.folder_id,
}
@@ -14,6 +14,7 @@
export let show = false;
export let variables = {};
export let title = $i18n.t('Input Variables');
export let onSave = (e) => {};
@@ -67,7 +68,9 @@
<Modal bind:show size="md">
<div>
<div class=" flex justify-between dark:text-gray-300 px-4 pt-3 pb-1">
<div class=" text-sm font-medium self-center">{$i18n.t('Input Variables')}</div>
<div class=" text-sm font-medium self-center">
{title}
</div>
<button
class="self-center rounded-lg p-1 text-gray-500 transition hover:bg-gray-50 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200"
on:click={() => {
@@ -78,7 +81,7 @@
</button>
</div>
<div class="flex flex-col md:flex-row w-full px-5 pb-4 md:space-x-4 dark:text-gray-200">
<div class="flex flex-col md:flex-row w-full px-4 pb-4 md:space-x-4 dark:text-gray-200">
<div class=" flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6">
<form
class="flex flex-col w-full"