From ace3303ff56dc78baae3b2b7d12831e3d529ebf6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 7 May 2025 01:11:28 +0400 Subject: [PATCH] enh: `TOOL_SERVER_CONNECTIONS` env var support --- backend/open_webui/config.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index e6851cfe7..5c617f190 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -921,11 +921,19 @@ OPENAI_API_BASE_URL = "https://api.openai.com/v1" # TOOL_SERVERS #################################### +try: + tool_server_connections = json.loads( + os.environ.get("TOOL_SERVER_CONNECTIONS", "[]") + ) +except Exception as e: + log.exception(f"Error loading TOOL_SERVER_CONNECTIONS: {e}") + tool_server_connections = [] + TOOL_SERVER_CONNECTIONS = PersistentConfig( "TOOL_SERVER_CONNECTIONS", "tool_server.connections", - [], + tool_server_connections, ) #################################### @@ -1002,6 +1010,7 @@ if default_prompt_suggestions == []: "content": "Could you start by asking me about instances when I procrastinate the most and then give me some suggestions to overcome it?", }, ] + DEFAULT_PROMPT_SUGGESTIONS = PersistentConfig( "DEFAULT_PROMPT_SUGGESTIONS", "ui.prompt_suggestions",