Class ThreadCreateAndRunParams.TruncationStrategy
-
- All Implemented Interfaces:
public final class ThreadCreateAndRunParams.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
ThreadCreateAndRunParams.TruncationStrategy.Builder
A builder for TruncationStrategy.
public final class
ThreadCreateAndRunParams.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 ThreadCreateAndRunParams.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<ThreadCreateAndRunParams.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 ThreadCreateAndRunParams.TruncationStrategy.Builder
toBuilder()
final ThreadCreateAndRunParams.TruncationStrategy
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ThreadCreateAndRunParams.TruncationStrategy.Builder
builder()
Returns a mutable builder for constructing an instance of TruncationStrategy. -
-
Method Detail
-
type
final ThreadCreateAndRunParams.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<ThreadCreateAndRunParams.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 ThreadCreateAndRunParams.TruncationStrategy.Builder toBuilder()
-
validate
final ThreadCreateAndRunParams.TruncationStrategy validate()
-
builder
final static ThreadCreateAndRunParams.TruncationStrategy.Builder builder()
Returns a mutable builder for constructing an instance of TruncationStrategy.
The following fields are required:
.type()
-
-
-
-