Class RealtimeTruncation
-
- All Implemented Interfaces:
public final class RealtimeTruncationControls how the realtime conversation is truncated prior to model inference. The default is
auto.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeTruncation.VisitorAn interface that defines how to map each variant of RealtimeTruncation to a value of type T.
public final classRealtimeTruncation.RealtimeTruncationStrategyThe truncation strategy to use for the session.
autois the default truncation strategy.disabledwill disable truncation and emit errors when the conversation exceeds the input token limit.
-
Method Summary
Modifier and Type Method Description final Optional<RealtimeTruncation.RealtimeTruncationStrategy>strategy()The truncation strategy to use for the session. final Optional<RealtimeTruncationRetentionRatio>retentionRatio()Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. final BooleanisStrategy()final BooleanisRetentionRatio()final RealtimeTruncation.RealtimeTruncationStrategyasStrategy()The truncation strategy to use for the session. final RealtimeTruncationRetentionRatioasRetentionRatio()Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. final Optional<JsonValue>_json()final <T extends Any> Taccept(RealtimeTruncation.Visitor<T> visitor)final RealtimeTruncationvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeTruncationofStrategy(RealtimeTruncation.RealtimeTruncationStrategy strategy)The truncation strategy to use for the session. final static RealtimeTruncationofRetentionRatio(RealtimeTruncationRetentionRatio retentionRatio)Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. -
-
Method Detail
-
strategy
final Optional<RealtimeTruncation.RealtimeTruncationStrategy> strategy()
The truncation strategy to use for the session.
autois the default truncation strategy.disabledwill disable truncation and emit errors when the conversation exceeds the input token limit.
-
retentionRatio
final Optional<RealtimeTruncationRetentionRatio> retentionRatio()
Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage.
-
isStrategy
final Boolean isStrategy()
-
isRetentionRatio
final Boolean isRetentionRatio()
-
asStrategy
final RealtimeTruncation.RealtimeTruncationStrategy asStrategy()
The truncation strategy to use for the session.
autois the default truncation strategy.disabledwill disable truncation and emit errors when the conversation exceeds the input token limit.
-
asRetentionRatio
final RealtimeTruncationRetentionRatio asRetentionRatio()
Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage.
-
accept
final <T extends Any> T accept(RealtimeTruncation.Visitor<T> visitor)
-
validate
final RealtimeTruncation validate()
-
ofStrategy
final static RealtimeTruncation ofStrategy(RealtimeTruncation.RealtimeTruncationStrategy strategy)
The truncation strategy to use for the session.
autois the default truncation strategy.disabledwill disable truncation and emit errors when the conversation exceeds the input token limit.
-
ofRetentionRatio
final static RealtimeTruncation ofRetentionRatio(RealtimeTruncationRetentionRatio retentionRatio)
Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage.
-
-
-
-