Class ThreadCreateAndRunParams.TruncationStrategy.Builder
-
- All Implemented Interfaces:
public final class ThreadCreateAndRunParams.TruncationStrategy.Builder
A builder for TruncationStrategy.
-
-
Method Summary
-
-
Method Detail
-
type
final ThreadCreateAndRunParams.TruncationStrategy.Builder type(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
.
-
type
final ThreadCreateAndRunParams.TruncationStrategy.Builder type(JsonField<ThreadCreateAndRunParams.TruncationStrategy.Type> type)
Sets Builder.type to an arbitrary JSON value.
You should usually call Builder.type with a well-typed Type value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
lastMessages
final ThreadCreateAndRunParams.TruncationStrategy.Builder lastMessages(Long lastMessages)
The number of most recent messages from the thread when constructing the context for the run.
-
lastMessages
final ThreadCreateAndRunParams.TruncationStrategy.Builder lastMessages(Long lastMessages)
Alias for Builder.lastMessages.
This unboxed primitive overload exists for backwards compatibility.
-
lastMessages
final ThreadCreateAndRunParams.TruncationStrategy.Builder lastMessages(Optional<Long> lastMessages)
Alias for calling Builder.lastMessages with
lastMessages.orElse(null)
.
-
lastMessages
final ThreadCreateAndRunParams.TruncationStrategy.Builder lastMessages(JsonField<Long> lastMessages)
Sets Builder.lastMessages to an arbitrary JSON value.
You should usually call Builder.lastMessages with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final ThreadCreateAndRunParams.TruncationStrategy.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ThreadCreateAndRunParams.TruncationStrategy.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ThreadCreateAndRunParams.TruncationStrategy.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ThreadCreateAndRunParams.TruncationStrategy.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ThreadCreateAndRunParams.TruncationStrategy.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ThreadCreateAndRunParams.TruncationStrategy build()
Returns an immutable instance of TruncationStrategy.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.type()
-
-
-
-