Skip to main content
Conversational agents pause their turn when a tool is gated with ToolApprovalConfig.REQUIRES_APPROVAL. The paused turn surfaces a SessionEvent on listen() with event.type == SessionEventType.APPROVAL_REQUEST. The session helpers let you reply on the same session without assembling raw payloads. What this demonstrates:
  • session.respond(event, approved=True) — dispatches on event type
  • session.respond_approval(event, approved=..., confirm=..., deny_reason=...)
  • The paused turn resumes and more MESSAGE_DELTA events flow
Requirements for a real e2e run:
  • A conversational agent whose tool(s) are already gated with
This example creates the tool and expects the agent’s approval gating to come from its server-side configuration.
Source: examples/agents/21_session_approval_respond.py in the SDK repo.