SessionMemoryState class
Mutable session memory state — tracks extraction lifecycle, thresholds, and the last summarised message.
Constructors
- SessionMemoryState({SessionMemoryConfig? config, String? lastSummarizedMessageId, int tokensAtLastExtraction = 0, bool initialized = false})
Properties
- config ↔ SessionMemoryConfig
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialized ↔ bool
-
getter/setter pair
- isExtracting → bool
-
Whether an extraction is currently in progress.
no setter
- isSessionMemoryInitialized → bool
-
Check if session memory has been initialised.
no setter
- lastSummarizedMessageId ↔ String?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tokensAtLastExtraction ↔ int
-
getter/setter pair
- toolCallsBetweenUpdates → int
-
Get the configured number of tool calls between updates.
no setter
Methods
-
hasMetInitializationThreshold(
int currentTokenCount) → bool - Check if we've met the threshold to initialise session memory.
-
hasMetUpdateThreshold(
int currentTokenCount) → bool - Check if we've met the threshold for the next update.
-
markExtractionCompleted(
) → void - Mark extraction as completed.
-
markExtractionStarted(
) → void - Mark extraction as started.
-
markInitialized(
) → void - Mark session memory as initialised.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordExtractionTokenCount(
int currentTokenCount) → void - Record the context size at the time of extraction.
-
reset(
) → void - Reset session memory state (useful for testing).
-
toString(
) → String -
A string representation of this object.
inherited
-
waitForExtraction(
) → Future< void> - Wait for any in-progress extraction to complete (with timeout).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited