Class RunCreateParams.TruncationStrategy
-
- All Implemented Interfaces:
public final class RunCreateParams.TruncationStrategyControls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classRunCreateParams.TruncationStrategy.BuilderA builder for TruncationStrategy.
public final classRunCreateParams.TruncationStrategy.TypeThe truncation strategy to use for the thread. The default is
auto. If set tolast_messages, the thread will be truncated to the n most recent messages in the thread. When set toauto, messages in the middle of the thread will be dropped to fit the context length of the model,max_prompt_tokens.
-
Method Summary
Modifier and Type Method Description final RunCreateParams.TruncationStrategy.Typetype()The truncation strategy to use for the thread. final Optional<Long>lastMessages()The number of most recent messages from the thread when constructing the context for the run. final JsonField<RunCreateParams.TruncationStrategy.Type>_type()Returns the raw JSON value of type. final JsonField<Long>_lastMessages()Returns the raw JSON value of lastMessages. final Map<String, JsonValue>_additionalProperties()final RunCreateParams.TruncationStrategy.BuildertoBuilder()final RunCreateParams.TruncationStrategyvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RunCreateParams.TruncationStrategy.Builderbuilder()Returns a mutable builder for constructing an instance of TruncationStrategy. -
-
Method Detail
-
type
final RunCreateParams.TruncationStrategy.Type type()
The truncation strategy to use for the thread. The default is
auto. If set tolast_messages, the thread will be truncated to the n most recent messages in the thread. When set toauto, messages in the middle of the thread will be dropped to fit the context length of the model,max_prompt_tokens.
-
lastMessages
final Optional<Long> lastMessages()
The number of most recent messages from the thread when constructing the context for the run.
-
_type
final JsonField<RunCreateParams.TruncationStrategy.Type> _type()
Returns the raw JSON value of type.
Unlike type, this method doesn't throw if the JSON field has an unexpected type.
-
_lastMessages
final JsonField<Long> _lastMessages()
Returns the raw JSON value of lastMessages.
Unlike lastMessages, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final RunCreateParams.TruncationStrategy.Builder toBuilder()
-
validate
final RunCreateParams.TruncationStrategy validate()
-
builder
final static RunCreateParams.TruncationStrategy.Builder builder()
Returns a mutable builder for constructing an instance of TruncationStrategy.
The following fields are required:
.type()
-
-
-
-