hangup.md
export const HANGUP_SIG_PY = call.hangup(final_instructions: str = "");
export const HANGUP_SIG_TS = await call.hangup(final_instructions?: string): Promise<void>;
export const HANGUP_EX_PY = @agent.on_task_complete("collect_order") def on_order_collected(call: guava.Call): call.hangup( final_instructions="Thank them for their time, mention the confirmation number, then hang up." );
export const HANGUP_EX_TS = agent.onTaskComplete("collect_order", async (call: guava.Call) => { await call.hangup( "Thank them for their time, mention the confirmation number, then hang up." ); });;
hangup()
call.hangup() is a soft hangup. Rather than cutting the call immediately, it hands the agent a final instruction and lets it close the conversation naturally before ending the call. Callers hear a proper goodbye.
<CodeTabs python={{ code: HANGUP_SIG_PY, filename: "signature" }} typescript={{ code: HANGUP_SIG_TS, filename: "signature" }} />
<PropTable rows={[ { name: "final_instructions", type: "str", desc: "What the agent should do before hanging up. If omitted, the agent ends the conversation naturally with no special instructions.", }, ]} />
Example
<CodeTabs python={{ code: HANGUP_EX_PY, filename: "example.py" }} typescript={{ code: HANGUP_EX_TS, filename: "example.ts" }} />