From 3bf7d569c6808abc4e9f16c8e349cf11c22396eb Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 22 Aug 2024 15:11:31 +0200 Subject: [PATCH] refac --- backend/apps/webui/main.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/backend/apps/webui/main.py b/backend/apps/webui/main.py index 0c5fdebd2..f75e5cf9e 100644 --- a/backend/apps/webui/main.py +++ b/backend/apps/webui/main.py @@ -297,20 +297,19 @@ async def generate_function_chat_completion(form_data, user): "name": user.name, "role": user.role, }, + "__tools__": get_tools( + app, + tool_ids, + user, + { + **extra_params, + "__model__": app.state.MODELS[form_data["model"]], + "__messages__": form_data["messages"], + "__files__": files, + }, + ), } - extra_params["__tools__"] = get_tools( - app, - tool_ids, - user, - { - **extra_params, - "__model__": app.state.MODELS[form_data["model"]], - "__messages__": form_data["messages"], - "__files__": files, - }, - ) - if model_info: if model_info.base_model_id: form_data["model"] = model_info.base_model_id