From 556bc8669a744471ad69771da01e87c00ee0bb04 Mon Sep 17 00:00:00 2001 From: Michael Poluektov Date: Mon, 19 Aug 2024 16:50:52 +0100 Subject: [PATCH] remove config options for now --- backend/apps/webui/main.py | 17 ++++++++--------- backend/config.py | 7 ------- backend/main.py | 10 ---------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/backend/apps/webui/main.py b/backend/apps/webui/main.py index 06c1a0921..e8b12f683 100644 --- a/backend/apps/webui/main.py +++ b/backend/apps/webui/main.py @@ -293,16 +293,15 @@ async def generate_function_chat_completion(form_data, user, files, tool_ids): "__event_call__": __event_call__, "__task__": __task__, } - if not ENABLE_TOOLS_FILTER: - tools_params = { - **extra_params, - "__model__": app.state.MODELS[form_data["model"]], - "__messages__": form_data["messages"], - "__files__": files, - } - configured_tools = get_tools(app, tool_ids, user, tools_params) + tools_params = { + **extra_params, + "__model__": app.state.MODELS[form_data["model"]], + "__messages__": form_data["messages"], + "__files__": files, + } + configured_tools = get_tools(app, tool_ids, user, tools_params) - extra_params["__tools__"] = configured_tools + extra_params["__tools__"] = configured_tools if model_info: if model_info.base_model_id: form_data["model"] = model_info.base_model_id diff --git a/backend/config.py b/backend/config.py index 1850fcefc..6d73eec0d 100644 --- a/backend/config.py +++ b/backend/config.py @@ -174,13 +174,6 @@ for version in soup.find_all("h2"): CHANGELOG = changelog_json -#################################### -# FILTERS -#################################### - -ENABLE_TOOLS_FILTER = os.environ.get("ENABLE_TOOLS_FILTER", "True").lower() == "true" -ENABLE_FILES_FILTER = os.environ.get("ENABLE_FILES_FILTER", "True").lower() == "true" - #################################### # SAFE_MODE #################################### diff --git a/backend/main.py b/backend/main.py index 53c92020f..823d1a9f4 100644 --- a/backend/main.py +++ b/backend/main.py @@ -119,8 +119,6 @@ from config import ( WEBUI_SESSION_COOKIE_SAME_SITE, WEBUI_SESSION_COOKIE_SECURE, ENABLE_ADMIN_CHAT_ACCESS, - ENABLE_TOOLS_FILTER, - ENABLE_FILES_FILTER, AppConfig, ) @@ -372,10 +370,6 @@ async def get_content_from_response(response) -> Optional[str]: async def chat_completion_tools_handler( body: dict, user: UserModel, extra_params: dict ) -> tuple[dict, dict]: - log.debug(f"{ENABLE_TOOLS_FILTER=}") - 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: @@ -467,10 +461,6 @@ async def chat_completion_tools_handler( async def chat_completion_files_handler(body) -> tuple[dict, dict[str, list]]: - log.debug(f"{ENABLE_FILES_FILTER=}") - if not ENABLE_FILES_FILTER: - return body, {} - contexts = [] citations = []