mirror of
https://github.com/open-webui/open-webui
synced 2025-04-14 20:43:37 +00:00
formatting
This commit is contained in:
parent
c6e32715e3
commit
3bc97cf3fb
@ -397,8 +397,12 @@ async def chat_action(request: Request, action_id: str, form_data: dict, user: A
|
|||||||
|
|
||||||
if hasattr(function_module, "valves") and hasattr(function_module, "Valves"):
|
if hasattr(function_module, "valves") and hasattr(function_module, "Valves"):
|
||||||
valves = Functions.get_function_valves_by_id(action_id)
|
valves = Functions.get_function_valves_by_id(action_id)
|
||||||
model_valves = model.get("info", {}).get("meta", {}).get("valves", {}).get(action_id, {})
|
model_valves = (
|
||||||
function_module.valves = function_module.Valves(**(valves if valves else {}), **model_valves)
|
model.get("info", {}).get("meta", {}).get("valves", {}).get(action_id, {})
|
||||||
|
)
|
||||||
|
function_module.valves = function_module.Valves(
|
||||||
|
**(valves if valves else {}), **model_valves
|
||||||
|
)
|
||||||
|
|
||||||
if hasattr(function_module, "action"):
|
if hasattr(function_module, "action"):
|
||||||
try:
|
try:
|
||||||
|
@ -62,7 +62,14 @@ async def process_filter_functions(
|
|||||||
if hasattr(function_module, "valves") and hasattr(function_module, "Valves"):
|
if hasattr(function_module, "valves") and hasattr(function_module, "Valves"):
|
||||||
valves = Functions.get_function_valves_by_id(filter_id)
|
valves = Functions.get_function_valves_by_id(filter_id)
|
||||||
# overwrite global valves with model valves
|
# overwrite global valves with model valves
|
||||||
model_valves = extra_params.get("__model__", {}).get("info", {}).get("meta", {}).get("valves", {}).get("functions", {}).get(filter_id, {})
|
model_valves = (
|
||||||
|
extra_params.get("__model__", {})
|
||||||
|
.get("info", {})
|
||||||
|
.get("meta", {})
|
||||||
|
.get("valves", {})
|
||||||
|
.get("functions", {})
|
||||||
|
.get(filter_id, {})
|
||||||
|
)
|
||||||
valves = {**valves, **model_valves}
|
valves = {**valves, **model_valves}
|
||||||
|
|
||||||
function_module.valves = function_module.Valves(
|
function_module.valves = function_module.Valves(
|
||||||
|
@ -54,7 +54,17 @@ def get_tools(
|
|||||||
if hasattr(module, "valves") and hasattr(module, "Valves"):
|
if hasattr(module, "valves") and hasattr(module, "Valves"):
|
||||||
valves = Tools.get_tool_valves_by_id(tool_id) or {}
|
valves = Tools.get_tool_valves_by_id(tool_id) or {}
|
||||||
# overwrite global valves with model valves
|
# overwrite global valves with model valves
|
||||||
valves = { **valves, **(extra_params.get("__model__", {}).get("info", {}).get("meta", {}).get("valves", {}).get("tools", {}).get(tool_id, {}))}
|
valves = {
|
||||||
|
**valves,
|
||||||
|
**(
|
||||||
|
extra_params.get("__model__", {})
|
||||||
|
.get("info", {})
|
||||||
|
.get("meta", {})
|
||||||
|
.get("valves", {})
|
||||||
|
.get("tools", {})
|
||||||
|
.get(tool_id, {})
|
||||||
|
),
|
||||||
|
}
|
||||||
module.valves = module.Valves(**valves)
|
module.valves = module.Valves(**valves)
|
||||||
|
|
||||||
if hasattr(module, "UserValves"):
|
if hasattr(module, "UserValves"):
|
||||||
|
Loading…
Reference in New Issue
Block a user