Actions
Action management system for conversation flows.
This module provides the ActionManager class which handles execution of actions during conversation state transitions. It supports:
Built-in actions (TTS, conversation ending)
Custom action registration
Synchronous and asynchronous handlers
Pre and post-transition actions
Error handling and validation
Actions are used to perform side effects during conversations, such as:
Text-to-speech output
Database updates
External API calls
Custom integrations
- class pipecat_flows.actions.FunctionActionFrame(action: dict, function: Callable[[dict[str, Any], FlowManager], Awaitable[None]])[source]
Bases:
ControlFrameFrame containing a function action to be executed.
- Parameters:
action – Action configuration dictionary.
function – Function handler to execute.
- action: dict
- class pipecat_flows.actions.ActionFinishedFrame[source]
Bases:
ControlFrameFrame indicating that an action has completed execution.
- class pipecat_flows.actions.ActionManager(worker: PipelineWorker, flow_manager: FlowManager)[source]
Bases:
objectManages the registration and execution of flow actions.
Actions are executed during state transitions and can include:
Text-to-speech output
Database updates
External API calls
Custom user-defined actions
Built-in actions:
tts_say: Speak text using TTS
end_conversation: End the current conversation
function: Execute inline functions in the pipeline
Custom actions can be registered using register_action().
- __init__(worker: PipelineWorker, flow_manager: FlowManager)[source]
Initialize the action manager.
- Parameters:
worker – PipelineWorker instance used to queue frames.
flow_manager – FlowManager instance that this ActionManager is part of.
- async execute_actions(actions: list[ActionConfig] | None) None[source]
Execute a list of actions.
- Parameters:
actions – List of action configurations to execute.
- Raises:
ActionError – If action execution fails.
Note
Each action must have a ‘type’ field matching a registered handler.