Class: OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio
- Defined in:
- lib/openai/models/realtime/realtime_truncation_retention_ratio.rb
Defined Under Namespace
Classes: TokenLimits
Instance Attribute Summary collapse
-
#retention_ratio ⇒ Float
Fraction of post-instruction conversation tokens to retain (‘0.0` - `1.0`) when the conversation exceeds the input token limit.
-
#token_limits ⇒ OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio::TokenLimits?
Optional custom token limits for this truncation strategy.
-
#type ⇒ Symbol, :retention_ratio
Use retention ratio truncation.
Instance Method Summary collapse
-
#initialize(retention_ratio:, token_limits: nil, type: :retention_ratio) ⇒ Object
constructor
Some parameter documentations has been truncated, see RealtimeTruncationRetentionRatio for more details.
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(retention_ratio:, token_limits: nil, type: :retention_ratio) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio for more details.
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.
|
|
# File 'lib/openai/models/realtime/realtime_truncation_retention_ratio.rb', line 29
|
Instance Attribute Details
#retention_ratio ⇒ Float
Fraction of post-instruction conversation tokens to retain (‘0.0` - `1.0`) when the conversation exceeds the input token limit. Setting this to `0.8` means that messages will be dropped until 80% of the maximum allowed tokens are used. This helps reduce the frequency of truncations and improve cache rates.
14 |
# File 'lib/openai/models/realtime/realtime_truncation_retention_ratio.rb', line 14 required :retention_ratio, Float |
#token_limits ⇒ OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio::TokenLimits?
Optional custom token limits for this truncation strategy. If not provided, the model’s default token limits will be used.
27 |
# File 'lib/openai/models/realtime/realtime_truncation_retention_ratio.rb', line 27 optional :token_limits, -> { OpenAI::Realtime::RealtimeTruncationRetentionRatio::TokenLimits } |
#type ⇒ Symbol, :retention_ratio
Use retention ratio truncation.
20 |
# File 'lib/openai/models/realtime/realtime_truncation_retention_ratio.rb', line 20 required :type, const: :retention_ratio |