Browse Source

remove config options for now

Michael Poluektov 8 months ago
parent
commit
556bc8669a
3 changed files with 8 additions and 26 deletions
  1. 8 9
      backend/apps/webui/main.py
  2. 0 7
      backend/config.py
  3. 0 10
      backend/main.py

+ 8 - 9
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

+ 0 - 7
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
 ####################################

+ 0 - 10
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 = []