소스 검색

fix: valves

Timothy J. Baek 10 달 전
부모
커밋
0250f69da0
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      backend/apps/webui/models/functions.py
  2. 1 1
      backend/apps/webui/models/tools.py

+ 1 - 1
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

+ 1 - 1
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