Session send() and on()
sendAndWait() is easy to understand because it returns quickly, but you only receive the final assistant message.
on().
on() with sendAndWait() is recommended.
Subscribe to a specific event type with on()
You can subscribe to only one event by passing a SessionEventType enum value or a string.
Subscribe to all event types
If you do not specify an event type, it subscribes to all events.For the latest updates, see the GitHub repository.