From 454f59d59aa3089b83131e0bd90b7fa316b3e841 Mon Sep 17 00:00:00 2001 From: Michael Poluektov Date: Tue, 20 Aug 2024 15:48:14 +0100 Subject: [PATCH] undo frontend change --- backend/main.py | 2 ++ src/lib/components/chat/Chat.svelte | 12 ++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/backend/main.py b/backend/main.py index 1fc292e5f..f00d6c382 100644 --- a/backend/main.py +++ b/backend/main.py @@ -526,6 +526,8 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): "message_id": body.pop("id", None), "session_id": body.pop("session_id", None), "valves": body.pop("valves", None), + "tool_ids": body.pop("tool_ids", None), + "files": body.pop("files", None), } __user__ = { diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 95161bf56..c805d82fa 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -844,10 +844,8 @@ }, format: $settings.requestFormat ?? undefined, keep_alive: $settings.keepAlive ?? undefined, - metadata: { - tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined, - files: files.length > 0 ? files : undefined - }, + tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined, + files: files.length > 0 ? files : undefined, session_id: $socket?.id, chat_id: $chatId, id: responseMessageId @@ -1138,10 +1136,8 @@ frequency_penalty: params?.frequency_penalty ?? $settings?.params?.frequency_penalty ?? undefined, max_tokens: params?.max_tokens ?? $settings?.params?.max_tokens ?? undefined, - metadata: { - tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined, - files: files.length > 0 ? files : undefined - }, + tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined, + files: files.length > 0 ? files : undefined, session_id: $socket?.id, chat_id: $chatId, id: responseMessageId