Session send() and on()
sendAndWait() is easy to reason about because it returns the response right away, but you only receive the final assistant message.
on().
on() with sendAndWait().
Specifying a particular event type with on()
Pass a SessionEventType enum or string to subscribe to a specific event only.
Subscribing to every event type
Omit the event type to subscribe to everything.For the latest updates, see the GitHub repository.