Class ChatCompletionMessage.Builder
-
- All Implemented Interfaces:
public final class ChatCompletionMessage.Builder
A builder for ChatCompletionMessage.
-
-
Method Summary
-
-
Method Detail
-
content
final ChatCompletionMessage.Builder content(String content)
The contents of the message.
-
content
final ChatCompletionMessage.Builder content(Optional<String> content)
Alias for calling Builder.content with
content.orElse(null)
.
-
content
final ChatCompletionMessage.Builder content(JsonField<String> content)
Sets Builder.content to an arbitrary JSON value.
You should usually call Builder.content with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
refusal
final ChatCompletionMessage.Builder refusal(String refusal)
The refusal message generated by the model.
-
refusal
final ChatCompletionMessage.Builder refusal(Optional<String> refusal)
Alias for calling Builder.refusal with
refusal.orElse(null)
.
-
refusal
final ChatCompletionMessage.Builder refusal(JsonField<String> refusal)
Sets Builder.refusal to an arbitrary JSON value.
You should usually call Builder.refusal with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
role
final ChatCompletionMessage.Builder role(JsonValue role)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("assistant")
This method is primarily for setting the field to an undocumented or not yet supported value.
-
annotations
final ChatCompletionMessage.Builder annotations(List<ChatCompletionMessage.Annotation> annotations)
Annotations for the message, when applicable, as when using the web search tool.
-
annotations
final ChatCompletionMessage.Builder annotations(JsonField<List<ChatCompletionMessage.Annotation>> annotations)
Sets Builder.annotations to an arbitrary JSON value.
You should usually call Builder.annotations with a well-typed
List<Annotation>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addAnnotation
final ChatCompletionMessage.Builder addAnnotation(ChatCompletionMessage.Annotation annotation)
Adds a single Annotation to annotations.
-
audio
final ChatCompletionMessage.Builder audio(ChatCompletionAudio audio)
If the audio output modality is requested, this object contains data about the audio response from the model. Learn more.
-
audio
final ChatCompletionMessage.Builder audio(Optional<ChatCompletionAudio> audio)
Alias for calling Builder.audio with
audio.orElse(null)
.
-
audio
final ChatCompletionMessage.Builder audio(JsonField<ChatCompletionAudio> audio)
Sets Builder.audio to an arbitrary JSON value.
You should usually call Builder.audio with a well-typed ChatCompletionAudio value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
functionCall
@Deprecated(message = "deprecated") final ChatCompletionMessage.Builder functionCall(ChatCompletionMessage.FunctionCall functionCall)
Deprecated and replaced by
tool_calls
. The name and arguments of a function that should be called, as generated by the model.
-
functionCall
@Deprecated(message = "deprecated") final ChatCompletionMessage.Builder functionCall(JsonField<ChatCompletionMessage.FunctionCall> functionCall)
Sets Builder.functionCall to an arbitrary JSON value.
You should usually call Builder.functionCall with a well-typed FunctionCall value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
toolCalls
final ChatCompletionMessage.Builder toolCalls(List<ChatCompletionMessageToolCall> toolCalls)
The tool calls generated by the model, such as function calls.
-
toolCalls
final ChatCompletionMessage.Builder toolCalls(JsonField<List<ChatCompletionMessageToolCall>> toolCalls)
Sets Builder.toolCalls to an arbitrary JSON value.
You should usually call Builder.toolCalls with a well-typed
List<ChatCompletionMessageToolCall>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addToolCall
final ChatCompletionMessage.Builder addToolCall(ChatCompletionMessageToolCall toolCall)
Adds a single ChatCompletionMessageToolCall to toolCalls.
-
additionalProperties
final ChatCompletionMessage.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ChatCompletionMessage.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ChatCompletionMessage.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ChatCompletionMessage.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ChatCompletionMessage.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ChatCompletionMessage build()
Returns an immutable instance of ChatCompletionMessage.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.content() .refusal()
-
-
-
-