From a933319adb28b556cdd085ca98eaecce74343130 Mon Sep 17 00:00:00 2001 From: Michael Poluektov Date: Mon, 19 Aug 2024 11:11:00 +0100 Subject: [PATCH] import error? --- backend/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/main.py b/backend/main.py index 0bd49ef3a..ad1d7388c 100644 --- a/backend/main.py +++ b/backend/main.py @@ -14,6 +14,7 @@ import requests import mimetypes import shutil import inspect +from typing import Optional from fastapi import FastAPI, Request, Depends, status, UploadFile, File, Form from fastapi.staticfiles import StaticFiles @@ -375,15 +376,16 @@ async def chat_completion_tools_handler( if not ENABLE_TOOLS_FILTER: return body, {} + # If tool_ids field is present, call the functions + tool_ids = body.pop("tool_ids", None) + if not tool_ids: + return body, {} + skip_files = False contexts = [] citations = [] task_model_id = get_task_model_id(body["model"]) - # If tool_ids field is present, call the functions - tool_ids = body.pop("tool_ids", None) - if not tool_ids: - return body, {} log.debug(f"{tool_ids=}")