add_actions

View as MarkdownOpen in Claude

Append multiple raw actions at once. Each action dictionary is added to the action list in order.

Parameters

actions
list[dict[str, Any]]Required

List of action dictionaries to append. Each dictionary should map a single action name to its payload.

Returns

FunctionResult — self, for chaining.

Example

from signalwire import AgentBase
from signalwire import FunctionResult
agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")
@agent.tool(name="batch_actions", description="Process multiple actions at once")
def batch_actions(args, raw_data):
return (
FunctionResult("Processing your request.")
.add_actions([
{"set_global_data": {"key": "value"}},
{"hold": 60},
{"say": "Please wait."}
])
)
agent.serve()