Class ChatRequest.Builder
- Enclosing class:
ChatRequest
-
Method Summary
Modifier and TypeMethodDescriptionaddAllMessages(List<ChatMessage> messages) additionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) addMessages(ChatMessage messages) allowGlobalRegion(Boolean allowGlobalRegion) allowGlobalRegion(Optional<Boolean> allowGlobalRegion) Opt this request into global (non-US) region serving for lower cost.build()from(ChatRequest other) Maximum number of tokens to generate.messages(List<ChatMessage> messages) The conversation history, in order.Model alias to use, from the list returned byGET /v1/models.temperature(Float temperature) temperature(Optional<Float> temperature) Sampling temperature, between 0.0 and 1.0.Top-p (nucleus) sampling.
-
Method Details
-
from
-
messages
The conversation history, in order. A message with role
systemis extracted and used as the system prompt;userandassistantmessages are sent to the model as conversation turns. -
addMessages
-
addAllMessages
-
model
Model alias to use, from the list returned by
GET /v1/models. Defaults toclaude-haiku-4-5. -
model
-
maxTokens
Maximum number of tokens to generate. Defaults to 2048; the maximum is 8192.
-
maxTokens
-
temperature
Sampling temperature, between 0.0 and 1.0. Higher values produce more varied output. Defaults to 0.7.
-
temperature
-
topP
Top-p (nucleus) sampling. Ignored when
temperatureis greater than 0. -
topP
-
allowGlobalRegion
Opt this request into global (non-US) region serving for lower cost. Requires a signed global-processing waiver on your account that permits per-request override; otherwise the request is rejected with 403. When omitted, the request follows your account's default residency setting. Configure data residency under Data Residency and Region settings in the developer portal.
-
allowGlobalRegion
-
build
-
additionalProperty
-
additionalProperties
-