mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
enh: Actions __webui__ flag support
This commit is contained in:
@@ -1026,6 +1026,10 @@ async def get_all_models():
|
||||
function_module, _, _ = load_function_module_by_id(action_id)
|
||||
webui_app.state.FUNCTIONS[action_id] = function_module
|
||||
|
||||
__webui__ = False
|
||||
if hasattr(function_module, "__webui__"):
|
||||
__webui__ = function_module.__webui__
|
||||
|
||||
if hasattr(function_module, "actions"):
|
||||
actions = function_module.actions
|
||||
model["actions"].extend(
|
||||
@@ -1039,6 +1043,7 @@ async def get_all_models():
|
||||
"icon_url": _action.get(
|
||||
"icon_url", action.meta.manifest.get("icon_url", None)
|
||||
),
|
||||
**({"__webui__": __webui__} if __webui__ else {}),
|
||||
}
|
||||
for _action in actions
|
||||
]
|
||||
@@ -1050,6 +1055,7 @@ async def get_all_models():
|
||||
"name": action.name,
|
||||
"description": action.meta.description,
|
||||
"icon_url": action.meta.manifest.get("icon_url", None),
|
||||
**({"__webui__": __webui__} if __webui__ else {}),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user