metaprompting.action.Action
- class metaprompting.action.Action[source]
Bases:
ABC
An executable node that takes zero or more input_states, executes an action, and returns its output to the output_state.
- Parameters:
input_states – Iterable over input
State
soutput_state – Output
State
Public Methods:
__init__
()An executable node that takes zero or more input_states, executes an action, and returns its output to the output_state.
block
([state])add_input_states
(states)set_output_state
(state[, force])input_trigger
(input)Trigger the
Action
from a specific input, typically when the input has been updated.execute
()Private Methods:
_execute
()Excecute the
Action
with given arguments and pass on the output to the outputState
.
- __abstractmethods__ = frozenset({})
- __annotations__ = {}
- __dict__ = mappingproxy({'__module__': 'metaprompting.action', '__init__': <function Action.__init__>, 'block': <function Action.block>, 'add_input_states': <function Action.add_input_states>, 'set_output_state': <function Action.set_output_state>, 'input_trigger': <function Action.input_trigger>, '_execute': <function Action._execute>, 'execute': <function Action.execute>, '__dict__': <attribute '__dict__' of 'Action' objects>, '__weakref__': <attribute '__weakref__' of 'Action' objects>, '__doc__': None, '__abstractmethods__': frozenset(), '_abc_impl': <_abc._abc_data object>, '__annotations__': {}})
- __init__()[source]
An executable node that takes zero or more input_states, executes an action, and returns its output to the output_state.
- Parameters:
input_states – Iterable over input
State
soutput_state – Output
State
- __module__ = 'metaprompting.action'
- __slots__ = ()
- __weakref__
list of weak references to the object (if defined)
- _abc_impl = <_abc._abc_data object>
- _execute()[source]
Excecute the
Action
with given arguments and pass on the output to the outputState
.