actionweaver.actions package

Submodules

actionweaver.actions.action module

class actionweaver.actions.action.Action(name, decorated_obj, scope=None, orch_expr=None, logger=None, stop=False)

Bases: object

bind(instance) InstanceAction
build_pydantic_model_cls(models=None, override_params=None)
invoke(chat, messages, force=True, stream=False)
json_schema()
exception actionweaver.actions.action.ActionException

Bases: Exception

class actionweaver.actions.action.ActionHandlers(*args, **kwargs)

Bases: object

check_orchestration_expr_validity(expr)
contains(name) bool
classmethod from_actions(actions)
classmethod merge(*handlers) ActionHandlers
scope(scope)
class actionweaver.actions.action.InstanceAction(name, decorated_obj, pydantic_cls, scope=None, orch_expr=None, logger=None, stop=False, instance=None)

Bases: Action

actionweaver.actions.action.action(name, scope='_default_action_scope_', logger=None, orch_expr=None, models=[], stop=False)

Decorator function to create an Action object.

Args: - name (str): Name of the action. - scope (str): Scope of the action, default is DEFAULT_ACTION_SCOPE. - logger (logging.Logger): Logger instance to log information, default is None. - models (list[pydantic.BaseModel]): List of pydantic models to be used in the action. - stop (bool): If True, the agent will stop immediately after invoking this action. Returns: - create_action: A function that takes a decorated object and returns an Action object.

actionweaver.actions.orchestration module

exception actionweaver.actions.orchestration.ActionOrchestrationParseError

Bases: Exception

class actionweaver.actions.orchestration.Orchestration(data: dict = None)

Bases: object

clear()
get(key, default=None)
items()
keys()
pop(key, default=None)

Remove the item with the specified key from the data dictionary and return its value. If the key is not found and a default value is provided, return the default value. If the key is not found and no default value is provided, raise a KeyError.

to_pyvis_network()

Experimental for debugging purpose

update(*args, **kwargs)
values()
actionweaver.actions.orchestration.build_orchestration_dict(action_handlers) Orchestration

Parse orchestration expressions from all actions.

actionweaver.actions.orchestration.parse_orchestration_expr(expr)

Module contents