hold
Put the call on hold. The caller hears hold music until the hold is released or
the timeout expires. During hold, speech detection is paused and the agent
doesn’t respond, so anything the caller needs to hear must be said before the
hold takes effect. Pass prompt and the method arranges that for you.
Parameters
prompt
Instruction for the model to deliver before the hold starts, in the second
person. Sets the response to
{"tool_result": "status: on hold", "tool_prompt": prompt} via
set_tool_response() and turns on post_process, so the
model speaks once more before the hold executes. An int in this position is
treated as timeout, so hold(120) still works.
timeout
Maximum hold duration in seconds. Clamped to the range 0 to 900.
step
Step to move to when the call is taken off hold. Without it the caller resumes in the step they left.
timeout_step
Step to move to when the hold times out. Without it the caller resumes in place.
step and timeout_step are deferred: the transition fires when the hold ends.
swml_change_step() applies immediately, so returning both a
hold and a change step in one result moves the caller before the hold begins.
When neither routing argument is given, the action is emitted as a bare integer
timeout, so existing output is unchanged.
Returns
FunctionResult — self, for chaining.