onEvent
Callback executed when an event is yielded by an agent during execution.
This is the ideal place to modify the event before it is persisted to the session service and yielded to the caller. Useful for logging events or transforming them before they reach the final consumer.
Return
The potentially modified Event to propagate downstream. The runner keeps event's id, invocation id and timestamp, and its author when the returned event has none.
Parameters
invocationContext
The context for the entire invocation.
event
The event raised by the runner.