Class RealtimeTruncation
-
- All Implemented Interfaces:
public final class RealtimeTruncation
Controls 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 interface
RealtimeTruncation.Visitor
An interface that defines how to map each variant of RealtimeTruncation to a value of type T.
public final class
RealtimeTruncation.RealtimeTruncationStrategy
The truncation strategy to use for the session.
auto
is the default truncation strategy.disabled
will 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 Boolean
isStrategy()
final Boolean
isRetentionRatio()
final RealtimeTruncation.RealtimeTruncationStrategy
asStrategy()
The truncation strategy to use for the session. final RealtimeTruncationRetentionRatio
asRetentionRatio()
Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. final Optional<JsonValue>
_json()
final <T extends Any> T
accept(RealtimeTruncation.Visitor<T> visitor)
final RealtimeTruncation
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RealtimeTruncation
ofStrategy(RealtimeTruncation.RealtimeTruncationStrategy strategy)
The truncation strategy to use for the session. final static RealtimeTruncation
ofRetentionRatio(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.
auto
is the default truncation strategy.disabled
will 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.
auto
is the default truncation strategy.disabled
will 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.
auto
is the default truncation strategy.disabled
will 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.
-
-
-
-