Timothy Jaeryang Baek 3 هفته پیش
والد
کامیت
f0856bcb46
2فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 1 1
      backend/open_webui/functions.py
  2. 3 1
      backend/open_webui/routers/functions.py

+ 1 - 1
backend/open_webui/functions.py

@@ -67,7 +67,7 @@ def get_function_module_by_id(request: Request, pipe_id: str):
         if valves:
             try:
                 function_module.valves = Valves(
-                    **{k: v for k, v in valves if v is not None}
+                    **{k: v for k, v in valves.items() if v is not None}
                 )
             except Exception as e:
                 log.exception(f"Error loading valves for function {pipe_id}: {e}")

+ 3 - 1
backend/open_webui/routers/functions.py

@@ -151,7 +151,9 @@ async def sync_functions(
             if hasattr(function_module, "Valves") and function.valves:
                 Valves = function_module.Valves
                 try:
-                    Valves(**{k: v for k, v in function.valves if v is not None})
+                    Valves(
+                        **{k: v for k, v in function.valves.items() if v is not None}
+                    )
                 except Exception as e:
                     log.exception(
                         f"Error validating valves for function {function.id}: {e}"