Class ChatRequest.Builder
- Enclosing class:
ChatRequest
ChatRequest.
Override semantics: when parameters(ChatRequestParameters) is set together with
one or more individual setters (e.g., modelName(String),
temperature(Double), etc.), the values from the individual
setters take precedence over the corresponding fields of parameters, while all other
fields of parameters (including provider-specific fields on subclasses of
ChatRequestParameters) are preserved. Merging is performed via
ChatRequestParameters.overrideWith(ChatRequestParameters), which only overrides with
non-null (and, for collections, non-empty) values — setting a field back to null via
an individual setter will not clear an existing value on parameters.
This makes it easy to modify a single field of an existing ChatRequest via
ChatRequest.toBuilder() without losing any other configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()frequencyPenalty(Double frequencyPenalty) maxOutputTokens(Integer maxOutputTokens) messages(ChatMessage... messages) messages(List<ChatMessage> messages) parameters(ChatRequestParameters parameters) Sets theChatRequestParametersto be used as the base for this request.presencePenalty(Double presencePenalty) responseFormat(ResponseFormat responseFormat) stopSequences(List<String> stopSequences) temperature(Double temperature) toolChoice(ToolChoice toolChoice) toolSpecifications(ToolSpecification... toolSpecifications) toolSpecifications(List<ToolSpecification> toolSpecifications)
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
messages
-
messages
-
parameters
Sets theChatRequestParametersto be used as the base for this request.Any individual setters called on this
ChatRequest.Builder(e.g.,modelName(String),temperature(Double), etc.) will override the corresponding fields of the suppliedparameters; all other fields ofparametersare preserved. SeeChatRequest.Builderfor full override semantics. -
modelName
-
temperature
-
topP
-
topK
-
frequencyPenalty
-
presencePenalty
-
maxOutputTokens
-
stopSequences
-
toolSpecifications
-
toolSpecifications
-
toolChoice
-
responseFormat
-
build
-