You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As similar as pipe funciton has pipes attribute, action functions can have an actions attribute.
At least, there are handling codes (code fragment 1), but it cannott be reached.
An actions attribute in an action function module is checked at code fragment 1.
As we can see from code fragment 3, get_function_module_by_id() only sets its local variable function_module and returns nothing.
Therefore, the function_module at code fragment 2 is constantly None then hasattr(module, "actions") at code fragment 1 becomes false.
Without modification, only 1 action button was shown even though actions has 2 entries.
After the proposed modification, 2 action buttons are shown as expected.
# Process action_ids to get the actionsdefget_action_items_from_module(function, module):
actions= []
ifhasattr(module, "actions"):
actions=module.actionsreturn [
{
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
As similar as pipe funciton has
pipesattribute, action functions can have anactionsattribute.At least, there are handling codes (code fragment 1), but it cannott be reached.
An
actionsattribute in an action function module is checked at code fragment 1.As we can see from code fragment 3,
get_function_module_by_id()only sets its local variablefunction_moduleand returns nothing.Therefore, the
function_moduleat code fragment 2 is constantlyNonethenhasattr(module, "actions")at code fragment 1 becomesfalse.Without modification, only 1 action button was shown even though
actionshas 2 entries.After the proposed modification, 2 action buttons are shown as expected.
Code fragment
1.
actionsattribute is checked hereopen-webui/backend/open_webui/utils/models.py
Line 170 in b03fc97
2.
get_action_items_from_module()is called hereopen-webui/backend/open_webui/utils/models.py
Line 216 in b03fc97
3.
get_function_module_by_id()open-webui/backend/open_webui/utils/models.py
Line 196 in b03fc97
Proposed modification
Beta Was this translation helpful? Give feedback.
All reactions