From dce91a85570547c8511d28177b389a7e5fcae400 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 14 Oct 2024 00:28:21 -0700 Subject: [PATCH] fix: custom model action button issue --- backend/open_webui/env.py | 2 +- backend/open_webui/main.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index 15c8cd7cc..4b61e1a89 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -375,7 +375,7 @@ else: AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST ) except Exception: - AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST = None + AIOHTTP_CLIENT_TIMEOUT_OPENAI_MODEL_LIST = 3 #################################### # OFFLINE_MODE diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 5b819d78b..5adb98c2a 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -990,11 +990,13 @@ async def get_all_models(): owned_by = model["owned_by"] if "pipe" in model: pipe = model["pipe"] - - if "info" in model and "meta" in model["info"]: - action_ids.extend(model["info"]["meta"].get("actionIds", [])) break + if custom_model.meta: + meta = custom_model.meta.model_dump() + if "actionIds" in meta: + action_ids.extend(meta["actionIds"]) + models.append( { "id": custom_model.id, @@ -2385,7 +2387,7 @@ async def oauth_callback(provider: str, request: Request, response: Response): key="token", value=jwt_token, httponly=True, # Ensures the cookie is not accessible via JavaScript - samesite=WEBUI_SESSION_COOKIE_SAME_SITE, + samesite=WEBUI_SESSION_COOKIE_SAME_SITE, secure=WEBUI_SESSION_COOKIE_SECURE, )