getEvents

suspend fun getEvents(currentInvocation: Boolean = false, currentBranch: Boolean = false): List<Event>

Returns the current session's events from the in-memory Session.events, which SessionService.appendEvent keeps in sync. Reads memory rather than re-fetching from the session service each step, matching Python, Java, and Go ADK.

Return

A list of events from the current session.

Parameters

currentInvocation

Whether to filter the events by the current invocation.

currentBranch

Whether to filter the events by the current branch. The rule is author-asymmetric: a user event matches this branch, a descendant sub-branch, or no branch, and one carrying function responses must also answer a call issued on this branch or below, while every other event must sit on exactly this branch.