mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 22:08:07 +00:00
refac
This commit is contained in:
parent
589420c208
commit
97808ba1c3
@ -251,10 +251,12 @@ def get_function_params(function_module, form_data, user, extra_params=None):
|
|||||||
extra_params = {}
|
extra_params = {}
|
||||||
|
|
||||||
pipe_id = get_pipe_id(form_data)
|
pipe_id = get_pipe_id(form_data)
|
||||||
|
|
||||||
# Get the signature of the function
|
# Get the signature of the function
|
||||||
sig = inspect.signature(function_module.pipe)
|
sig = inspect.signature(function_module.pipe)
|
||||||
addition_params = {k: v for k, v in extra_params.items() if k in sig.parameters}
|
params = {"body": form_data} | {
|
||||||
params = {"body": form_data} | addition_params
|
k: v for k, v in extra_params.items() if k in sig.parameters
|
||||||
|
}
|
||||||
|
|
||||||
if "__user__" in params and hasattr(function_module, "UserValves"):
|
if "__user__" in params and hasattr(function_module, "UserValves"):
|
||||||
user_valves = Functions.get_user_valves_by_id_and_user_id(pipe_id, user.id)
|
user_valves = Functions.get_user_valves_by_id_and_user_id(pipe_id, user.id)
|
||||||
|
Loading…
Reference in New Issue
Block a user