mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-12 10:04:14 -05:00
refac
This commit is contained in:
@@ -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}")
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user