metaprompting.action.LlmAction

class metaprompting.action.LlmAction(llm, prompt_parts)[source]

Bases: Action

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 States

  • output_state – Output State

Public Methods:

__init__(llm, prompt_parts)

An executable node that takes zero or more input_states, executes an action, and returns its output to the output_state.

execute()

Inherited from Action

__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 Data Attributes:

_abc_impl

Inherited from Action

_abc_impl

Inherited from ABC

_abc_impl

Private Methods:

Inherited from Action

_execute()

Excecute the Action with given arguments and pass on the output to the output State.


__abstractmethods__ = frozenset({})
__annotations__ = {}
__dict__ = mappingproxy({'__module__': 'metaprompting.action', '__init__': <function LlmAction.__init__>, 'execute': <function LlmAction.execute>, '__doc__': None, '__abstractmethods__': frozenset(), '_abc_impl': <_abc._abc_data object>, '__annotations__': {}})
__init__(llm, prompt_parts)[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 States

  • output_state – Output State

__module__ = 'metaprompting.action'
__slots__ = ()
__weakref__

list of weak references to the object (if defined)

_abc_impl = <_abc._abc_data object>
_execute()

Excecute the Action with given arguments and pass on the output to the output State.

add_input_states(states)
block(state=True)
execute()[source]
input_trigger(input)

Trigger the Action from a specific input, typically when the input has been updated.

Parameters:

input – input State

set_output_state(state, force=False)