RealtimeTruncation class sealed
Truncation strategy for Realtime sessions.
A discriminated union covering the three supported strategies:
- TruncationAuto — string
"auto", the default truncation behaviour. - TruncationDisabled — string
"disabled", errors when context exceeds the token limit instead of dropping older messages. - TruncationRetentionRatio — object with
type: "retention_ratio", retains a configurable fraction of the conversation when truncating.
An UnknownRealtimeTruncation fallback preserves any unrecognised payload so future server additions do not break existing clients.
Constructors
- RealtimeTruncation.auto()
-
Auto strategy.
constfactory
- RealtimeTruncation.disabled()
-
Disabled strategy.
constfactory
- RealtimeTruncation.fromJson(Object json)
-
Creates from JSON.
factory
- RealtimeTruncation.retentionRatio({required double retentionRatio, int? postInstructionsTokenLimit})
-
Retention-ratio strategy.
constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Object - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited