# Session

data class Session(val key: SessionKey, val state: State = State(), val events: MutableList<Event> = mutableListOf(), var lastUpdateTime: Instant = Instant.fromEpochMilliseconds(0))

A Session object that encapsulates the State and Events of a session.

## Constructors

Session
Link copied to clipboard
constructor(key: SessionKey, state: State = State(), events: MutableList<Event> = mutableListOf(), lastUpdateTime: Instant = Instant.fromEpochMilliseconds(0))

## Properties

events
Link copied to clipboard
val events: MutableList<Event>

The events of the session, e.g. user input, model response, function call/response, etc.

key
Link copied to clipboard
val key: SessionKey

The composite identifier of the session (SessionKey.appName, SessionKey.userId, SessionKey.id).

lastUpdateTime
Link copied to clipboard
var lastUpdateTime: Instant

The last update time of the session. Defaults to Instant.EPOCH.

state
Link copied to clipboard
val state: State

The state of the session.