Class ThreadCreateParams
-
- All Implemented Interfaces:
public final class ThreadCreateParamsThe parameters of a message thread: the fields that every request of the thread sends, and the messages that the thread starts with.
The builder takes every field of MessageCreateParams except
thread, which the message thread sets on each request itself. Unlike MessageCreateParams, the messages are optional: a thread can start empty and get its first message from the first send.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumThreadCreateParams.UnsupportedRequestBehaviorWhat a message thread does when the API rejects a request with the error code
thread_unsupported_request, because the request uses something that a thread does not support.public final classThreadCreateParams.BuilderA builder for ThreadCreateParams.
-
Field Summary
Fields Modifier and Type Field Description private final MessageCreateParamsinitialMessageParams
-
Method Summary
-
-
Method Detail
-
initialMessageParams
final MessageCreateParams initialMessageParams()
The fields that the thread sends on its requests, with the messages that the thread starts with.
-
unsupportedRequestBehavior
final ThreadCreateParams.UnsupportedRequestBehavior unsupportedRequestBehavior()
What the thread does when the API answers that a request cannot be served on a thread. Defaults to UnsupportedRequestBehavior.ERROR.
-
betas
final Optional<List<AnthropicBeta>> betas()
-
userProfileId
final Optional<String> userProfileId()
-
workspaceId
final Optional<String> workspaceId()
-
messages
final List<BetaMessageParam> messages()
-
billingPolicy
final Optional<BetaBillingPolicy> billingPolicy()
-
cacheControl
final Optional<BetaCacheControlEphemeral> cacheControl()
-
compaction
final Optional<BetaCompactionConfig> compaction()
-
container
final Optional<MessageCreateParams.Container> container()
-
contextManagement
final Optional<BetaContextManagementConfig> contextManagement()
-
diagnostics
final Optional<BetaDiagnosticsParam> diagnostics()
-
fallbackCreditToken
final Optional<MessageCreateParams.FallbackCreditToken> fallbackCreditToken()
-
fallbacks
final Optional<BetaFallbacksParam> fallbacks()
-
inferenceGeo
final Optional<String> inferenceGeo()
-
mcpServers
final Optional<List<BetaRequestMcpServerUrlDefinition>> mcpServers()
-
metadata
final Optional<BetaMetadata> metadata()
-
outputConfig
final Optional<BetaOutputConfig> outputConfig()
-
outputFormat
@Deprecated(message = "deprecated") final Optional<BetaJsonOutputFormat> outputFormat()
-
serviceTier
final Optional<MessageCreateParams.ServiceTier> serviceTier()
-
speed
final Optional<MessageCreateParams.Speed> speed()
-
stopSequences
final Optional<List<String>> stopSequences()
-
system
final Optional<MessageCreateParams.System> system()
-
thinking
final Optional<BetaThinkingConfigParam> thinking()
-
toolChoice
final Optional<BetaToolChoice> toolChoice()
-
tools
final Optional<List<BetaToolUnion>> tools()
-
_maxTokens
final JsonField<Long> _maxTokens()
Returns the raw JSON value of maxTokens.
Unlike maxTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_messages
final JsonField<List<BetaMessageParam>> _messages()
Returns the raw JSON value of messages.
Unlike messages, this method doesn't throw if the JSON field has an unexpected type.
-
_model
final JsonField<Model> _model()
Returns the raw JSON value of model.
Unlike model, this method doesn't throw if the JSON field has an unexpected type.
-
_billingPolicy
final JsonField<BetaBillingPolicy> _billingPolicy()
Returns the raw JSON value of billingPolicy.
Unlike billingPolicy, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheControl
final JsonField<BetaCacheControlEphemeral> _cacheControl()
Returns the raw JSON value of cacheControl.
Unlike cacheControl, this method doesn't throw if the JSON field has an unexpected type.
-
_compaction
final JsonField<BetaCompactionConfig> _compaction()
Returns the raw JSON value of compaction.
Unlike compaction, this method doesn't throw if the JSON field has an unexpected type.
-
_container
final JsonField<MessageCreateParams.Container> _container()
Returns the raw JSON value of container.
Unlike container, this method doesn't throw if the JSON field has an unexpected type.
-
_contextManagement
final JsonField<BetaContextManagementConfig> _contextManagement()
Returns the raw JSON value of contextManagement.
Unlike contextManagement, this method doesn't throw if the JSON field has an unexpected type.
-
_diagnostics
final JsonField<BetaDiagnosticsParam> _diagnostics()
Returns the raw JSON value of diagnostics.
Unlike diagnostics, this method doesn't throw if the JSON field has an unexpected type.
-
_fallbackCreditToken
final JsonField<MessageCreateParams.FallbackCreditToken> _fallbackCreditToken()
Returns the raw JSON value of fallbackCreditToken.
Unlike fallbackCreditToken, this method doesn't throw if the JSON field has an unexpected type.
-
_fallbacks
final JsonField<BetaFallbacksParam> _fallbacks()
Returns the raw JSON value of fallbacks.
Unlike fallbacks, this method doesn't throw if the JSON field has an unexpected type.
-
_inferenceGeo
final JsonField<String> _inferenceGeo()
Returns the raw JSON value of inferenceGeo.
Unlike inferenceGeo, this method doesn't throw if the JSON field has an unexpected type.
-
_mcpServers
final JsonField<List<BetaRequestMcpServerUrlDefinition>> _mcpServers()
Returns the raw JSON value of mcpServers.
Unlike mcpServers, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<BetaMetadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_outputConfig
final JsonField<BetaOutputConfig> _outputConfig()
Returns the raw JSON value of outputConfig.
Unlike outputConfig, this method doesn't throw if the JSON field has an unexpected type.
-
_outputFormat
@Deprecated(message = "deprecated") final JsonField<BetaJsonOutputFormat> _outputFormat()
Returns the raw JSON value of outputFormat.
Unlike outputFormat, this method doesn't throw if the JSON field has an unexpected type.
-
_serviceTier
final JsonField<MessageCreateParams.ServiceTier> _serviceTier()
Returns the raw JSON value of serviceTier.
Unlike serviceTier, this method doesn't throw if the JSON field has an unexpected type.
-
_speed
final JsonField<MessageCreateParams.Speed> _speed()
Returns the raw JSON value of speed.
Unlike speed, this method doesn't throw if the JSON field has an unexpected type.
-
_stopSequences
final JsonField<List<String>> _stopSequences()
Returns the raw JSON value of stopSequences.
Unlike stopSequences, this method doesn't throw if the JSON field has an unexpected type.
-
_system
final JsonField<MessageCreateParams.System> _system()
Returns the raw JSON value of system.
Unlike system, this method doesn't throw if the JSON field has an unexpected type.
-
_thinking
final JsonField<BetaThinkingConfigParam> _thinking()
Returns the raw JSON value of thinking.
Unlike thinking, this method doesn't throw if the JSON field has an unexpected type.
-
_toolChoice
final JsonField<BetaToolChoice> _toolChoice()
Returns the raw JSON value of toolChoice.
Unlike toolChoice, this method doesn't throw if the JSON field has an unexpected type.
-
_tools
final JsonField<List<BetaToolUnion>> _tools()
Returns the raw JSON value of tools.
Unlike tools, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
-
toBuilder
final ThreadCreateParams.Builder toBuilder()
-
builder
final static ThreadCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of ThreadCreateParams.
The following fields are required:
.maxTokens() .model()
-
-
-
-