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

1from signalwire import AgentBase
2from signalwire import FunctionResult
3
4agent = AgentBase(name="my-agent", route="/agent")
5agent.set_prompt_text("You are a helpful assistant.")
6
7@agent.tool(name="batch_actions", description="Process multiple actions at once")
8def batch_actions(args, raw_data):
9 return (
10 FunctionResult("Processing your request.")
11 .add_actions([
12 {"set_global_data": {"key": "value"}},
13 {"hold": 60},
14 {"say": "Please wait."}
15 ])
16 )
17
18agent.serve()