mirror of
https://github.com/open-webui/open-webui
synced 2024-11-22 08:07:55 +00:00
fix
This commit is contained in:
parent
b0a19d0dda
commit
0faa39ace9
@ -1047,17 +1047,17 @@ async def get_all_models():
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Process action_ids to get the actions
|
# Process action_ids to get the actions
|
||||||
def get_action_items_from_module(module):
|
def get_action_items_from_module(function, module):
|
||||||
actions = []
|
actions = []
|
||||||
if hasattr(module, "actions"):
|
if hasattr(module, "actions"):
|
||||||
actions = module.actions
|
actions = module.actions
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"id": f"{module.id}.{action['id']}",
|
"id": f"{function.id}.{action['id']}",
|
||||||
"name": action.get("name", f"{module.name} ({action['id']})"),
|
"name": action.get("name", f"{function.name} ({action['id']})"),
|
||||||
"description": module.meta.description,
|
"description": function.meta.description,
|
||||||
"icon_url": action.get(
|
"icon_url": action.get(
|
||||||
"icon_url", module.meta.manifest.get("icon_url", None)
|
"icon_url", function.meta.manifest.get("icon_url", None)
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
for action in actions
|
for action in actions
|
||||||
@ -1065,10 +1065,10 @@ async def get_all_models():
|
|||||||
else:
|
else:
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"id": module.id,
|
"id": function.id,
|
||||||
"name": module.name,
|
"name": function.name,
|
||||||
"description": module.meta.description,
|
"description": function.meta.description,
|
||||||
"icon_url": module.meta.manifest.get("icon_url", None),
|
"icon_url": function.meta.manifest.get("icon_url", None),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1093,7 +1093,9 @@ async def get_all_models():
|
|||||||
raise Exception(f"Action not found: {action_id}")
|
raise Exception(f"Action not found: {action_id}")
|
||||||
|
|
||||||
function_module = get_function_module_by_id(action_id)
|
function_module = get_function_module_by_id(action_id)
|
||||||
model["actions"].extend(get_action_items_from_module(function_module))
|
model["actions"].extend(
|
||||||
|
get_action_items_from_module(action_function, function_module)
|
||||||
|
)
|
||||||
return models
|
return models
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user