session.listen().
You’ll end up with. Tagged log lines ([Thinking], [Tool Call], [Search], [Status]) interleaved with streamed message tokens.
Demonstrates listening for all event types including TOOL_CALL and THINKING
events during a session with a tool-equipped conversational agent.
Expected output
[Thinking] line only appears for models that emit reasoning summaries; [Tool Call] and [Search] always show up when a search tool fires. MESSAGE_DELTA tokens stream right after the search result lands.
See also
Single-turn session
The minimal listener shape — filter to a handful of event types.
Session approval respond
Add APPROVAL_REQUEST handling on top of the event loop.
Session reference
Session, listen(), and event types in detail.
