runAsync
open override fun runAsync(userId: String, sessionId: String, invocationId: String? = null, newMessage: Content? = null, stateDelta: Map<String, Any>? = null, runConfig: RunConfig? = null): Flow<Event>
Main entry method to run the agent in this runner.
Flushes sessionService after appending each final response and before emitting it, and when the run completes or fails with an exception, but not when it is canceled (including by a collector that stops early) or fails with an Error. A failed flush is thrown, or attached as suppressed if the run already failed; an end-of-run flush can fail only after the last event was emitted.
Return
The events generated by the agent.
Parameters
userId
The user ID of the session.
sessionId
The session ID of the session.
invocationId
The invocation ID of the session, set this to resume an interrupted invocation.
newMessage
A new message to append to the session.
stateDelta
Optional state changes to apply to the session.
runConfig
The run config for the agent.