enable_functions_on_timeout

View as MarkdownOpen in Claude

Control whether SWAIG functions can be called when a speaker timeout occurs. When enabled, the agent can invoke functions after the user has been silent for the configured timeout period.

Parameters

enabled
boolDefaults to True

True to allow function calls on speaker timeout, False to disable.

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="enable_escalation_on_timeout", description="Enable function calls on timeout")
def enable_escalation_on_timeout(args, raw_data):
return (
FunctionResult("I'll help you with that.")
.enable_functions_on_timeout(enabled=True)
)
agent.serve()