execute_swml
execute_swml
Execute a raw SWML document as an action. This is the escape hatch for advanced use cases that are not covered by the named convenience methods.
Raises TypeError if swml_content is not a str, dict, or an object with a
.to_dict() method.
Most use cases are covered by the specific action methods
(connect(),
record_call(),
send_sms(), etc.).
Use execute_swml() only when you need SWML features not available through
convenience methods.
Parameters
swml_content
SWML content in one of three formats:
str— raw SWML JSON text (parsed internally)dict— SWML data structure- SWML object — any object with a
.to_dict()method (e.g., aSWMLBuilderinstance)
transfer
When True, the call exits the agent after the SWML executes. When False,
the SWML executes inline and the agent continues.
Returns
FunctionResult — self, for chaining.