From 0250f69da02d315d799a557714b3f6412089481a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 23 Jun 2024 19:48:16 -0700 Subject: [PATCH] fix: valves --- backend/apps/webui/models/functions.py | 2 +- backend/apps/webui/models/tools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/apps/webui/models/functions.py b/backend/apps/webui/models/functions.py index 966bd0231..f4366a1a7 100644 --- a/backend/apps/webui/models/functions.py +++ b/backend/apps/webui/models/functions.py @@ -146,7 +146,7 @@ class FunctionsTable: def get_function_valves_by_id(self, id: str) -> Optional[dict]: try: function = Function.get(Function.id == id) - return function.valves if "valves" in function and function.valves else {} + return function.valves if function.valves else {} except Exception as e: print(f"An error occurred: {e}") return None diff --git a/backend/apps/webui/models/tools.py b/backend/apps/webui/models/tools.py index 41504bd4a..bfa65742b 100644 --- a/backend/apps/webui/models/tools.py +++ b/backend/apps/webui/models/tools.py @@ -117,7 +117,7 @@ class ToolsTable: def get_tool_valves_by_id(self, id: str) -> Optional[dict]: try: tool = Tool.get(Tool.id == id) - return tool.valves if "valves" in tool and tool.valves else {} + return tool.valves if tool.valves else {} except Exception as e: print(f"An error occurred: {e}") return None