From 4a21c5c5e7cb287a9b93ea2dfff21308048b0b3c Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 21 Aug 2024 22:42:25 +0200 Subject: [PATCH] refac --- backend/apps/webui/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/apps/webui/main.py b/backend/apps/webui/main.py index f4184d616..bede4b4f8 100644 --- a/backend/apps/webui/main.py +++ b/backend/apps/webui/main.py @@ -278,7 +278,11 @@ async def generate_function_chat_completion(form_data, user): model_info = Models.get_model_by_id(model_id) metadata = form_data.pop("metadata", {}) files = metadata.get("files", []) - tool_ids = metadata.get("tool_ids") if metadata.get("tool_ids") else [] + tool_ids = metadata.get("tool_ids", []) + + # Check if tool_ids is None + if tool_ids is None: + tool_ids = [] __event_emitter__ = None __event_call__ = None