TruncationRetentionRatio class

Retention-ratio truncation strategy.

Retains retentionRatio (0.0–1.0) of the post-instruction conversation tokens when the conversation exceeds the input token limit. Optionally accepts a custom postInstructionsTokenLimit.

Inheritance
Annotations
  • @immutable

Constructors

TruncationRetentionRatio({required double retentionRatio, int? postInstructionsTokenLimit})
Creates a TruncationRetentionRatio.
const
TruncationRetentionRatio.fromJson(Map<String, dynamic> json)
Creates from JSON.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
postInstructionsTokenLimit int?
Optional custom post-instructions token limit.
final
retentionRatio double
Fraction of post-instruction tokens to retain (0.0–1.0).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The discriminator value. Always "retention_ratio".
no setter

Methods

copyWith({double? retentionRatio, Object? postInstructionsTokenLimit = unsetCopyWithValue}) TruncationRetentionRatio
Returns a copy of this TruncationRetentionRatio with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override