From 9652c8f8af4909b7c44447aad3fe74d59c539e11 Mon Sep 17 00:00:00 2001 From: Michael Poluektov Date: Mon, 19 Aug 2024 16:57:29 +0100 Subject: [PATCH] dont delete files and tool_ids --- backend/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/main.py b/backend/main.py index 823d1a9f4..461ae937b 100644 --- a/backend/main.py +++ b/backend/main.py @@ -371,7 +371,7 @@ async def chat_completion_tools_handler( body: dict, user: UserModel, extra_params: dict ) -> tuple[dict, dict]: # If tool_ids field is present, call the functions - tool_ids = body.pop("tool_ids", None) + tool_ids = body.get("tool_ids", None) if not tool_ids: return body, {} @@ -464,7 +464,7 @@ async def chat_completion_files_handler(body) -> tuple[dict, dict[str, list]]: contexts = [] citations = [] - if files := body.pop("files", None): + if files := body.get("files", None): contexts, citations = get_rag_context( files=files, messages=body["messages"],