AgentsAgentBase

setup_graceful_shutdown

View as MarkdownOpen in Claude

Register signal handlers for SIGTERM and SIGINT so the agent shuts down cleanly. This is especially useful in Kubernetes deployments where the pod receives SIGTERM before termination.

Parameters

None.

Returns

None

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="support", route="/support")
4agent.set_prompt_text("You are a helpful assistant.")
5agent.setup_graceful_shutdown()
6agent.serve()