Class BetaThreadCreateAndRunParams.TruncationStrategy
-
- All Implemented Interfaces:
public final class BetaThreadCreateAndRunParams.TruncationStrategy
Controls for how a thread will be truncated prior to the run. Use this to control the intial context window of the run.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
BetaThreadCreateAndRunParams.TruncationStrategy.Builder
A builder for TruncationStrategy.
public final class
BetaThreadCreateAndRunParams.TruncationStrategy.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
.
-
Method Summary
Modifier and Type Method Description final BetaThreadCreateAndRunParams.TruncationStrategy.Type
type()
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<BetaThreadCreateAndRunParams.TruncationStrategy.Type>
_type()
The truncation strategy to use for the thread. final JsonField<Long>
_lastMessages()
The number of most recent messages from the thread when constructing the context for the run. final Map<String, JsonValue>
_additionalProperties()
final BetaThreadCreateAndRunParams.TruncationStrategy
validate()
final BetaThreadCreateAndRunParams.TruncationStrategy.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static BetaThreadCreateAndRunParams.TruncationStrategy.Builder
builder()
-
-
Method Detail
-
type
final BetaThreadCreateAndRunParams.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<BetaThreadCreateAndRunParams.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 JsonField<Long> _lastMessages()
The number of most recent messages from the thread when constructing the context for the run.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final BetaThreadCreateAndRunParams.TruncationStrategy validate()
-
toBuilder
final BetaThreadCreateAndRunParams.TruncationStrategy.Builder toBuilder()
-
builder
final static BetaThreadCreateAndRunParams.TruncationStrategy.Builder builder()
-
-
-
-