Class Run.TruncationStrategy.Builder
-
- All Implemented Interfaces:
public final class Run.TruncationStrategy.Builder
A builder for TruncationStrategy.
-
-
Method Summary
Modifier and Type Method Description final Run.TruncationStrategy.Builder
type(Run.TruncationStrategy.Type type)
The truncation strategy to use for the thread. final Run.TruncationStrategy.Builder
type(JsonField<Run.TruncationStrategy.Type> type)
The truncation strategy to use for the thread. final Run.TruncationStrategy.Builder
lastMessages(Long lastMessages)
The number of most recent messages from the thread when constructing the context for the run. final Run.TruncationStrategy.Builder
lastMessages(Long lastMessages)
The number of most recent messages from the thread when constructing the context for the run. final Run.TruncationStrategy.Builder
lastMessages(Optional<Long> lastMessages)
The number of most recent messages from the thread when constructing the context for the run. final Run.TruncationStrategy.Builder
lastMessages(JsonField<Long> lastMessages)
The number of most recent messages from the thread when constructing the context for the run. final Run.TruncationStrategy.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final Run.TruncationStrategy.Builder
putAdditionalProperty(String key, JsonValue value)
final Run.TruncationStrategy.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final Run.TruncationStrategy.Builder
removeAdditionalProperty(String key)
final Run.TruncationStrategy.Builder
removeAllAdditionalProperties(Set<String> keys)
final Run.TruncationStrategy
build()
-
-
Method Detail
-
type
final Run.TruncationStrategy.Builder type(Run.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
.
-
type
final Run.TruncationStrategy.Builder type(JsonField<Run.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 Run.TruncationStrategy.Builder lastMessages(Long lastMessages)
The number of most recent messages from the thread when constructing the context for the run.
-
lastMessages
final Run.TruncationStrategy.Builder lastMessages(Long lastMessages)
The number of most recent messages from the thread when constructing the context for the run.
-
lastMessages
final Run.TruncationStrategy.Builder lastMessages(Optional<Long> lastMessages)
The number of most recent messages from the thread when constructing the context for the run.
-
lastMessages
final Run.TruncationStrategy.Builder lastMessages(JsonField<Long> lastMessages)
The number of most recent messages from the thread when constructing the context for the run.
-
additionalProperties
final Run.TruncationStrategy.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final Run.TruncationStrategy.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final Run.TruncationStrategy.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final Run.TruncationStrategy.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final Run.TruncationStrategy.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final Run.TruncationStrategy build()
-
-
-
-