Class ChatCompletion.Builder
-
- All Implemented Interfaces:
public final class ChatCompletion.Builder
A builder for ChatCompletion.
-
-
Method Summary
-
-
Method Detail
-
id
final ChatCompletion.Builder id(String id)
A unique identifier for the chat completion.
-
id
final ChatCompletion.Builder id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value.
You should usually call Builder.id with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
choices
final ChatCompletion.Builder choices(List<ChatCompletion.Choice> choices)
A list of chat completion choices. Can be more than one if
n
is greater than 1.
-
choices
final ChatCompletion.Builder choices(JsonField<List<ChatCompletion.Choice>> choices)
Sets Builder.choices to an arbitrary JSON value.
You should usually call Builder.choices with a well-typed
List<Choice>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addChoice
final ChatCompletion.Builder addChoice(ChatCompletion.Choice choice)
-
created
final ChatCompletion.Builder created(Long created)
The Unix timestamp (in seconds) of when the chat completion was created.
-
created
final ChatCompletion.Builder created(JsonField<Long> created)
Sets Builder.created to an arbitrary JSON value.
You should usually call Builder.created with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final ChatCompletion.Builder model(String model)
The model used for the chat completion.
-
model
final ChatCompletion.Builder model(JsonField<String> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
object_
final ChatCompletion.Builder object_(JsonValue object_)
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("chat.completion")
This method is primarily for setting the field to an undocumented or not yet supported value.
-
serviceTier
final ChatCompletion.Builder serviceTier(ChatCompletion.ServiceTier serviceTier)
The service tier used for processing the request.
-
serviceTier
final ChatCompletion.Builder serviceTier(Optional<ChatCompletion.ServiceTier> serviceTier)
Alias for calling Builder.serviceTier with
serviceTier.orElse(null)
.
-
serviceTier
final ChatCompletion.Builder serviceTier(JsonField<ChatCompletion.ServiceTier> serviceTier)
Sets Builder.serviceTier to an arbitrary JSON value.
You should usually call Builder.serviceTier with a well-typed ServiceTier value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
systemFingerprint
final ChatCompletion.Builder systemFingerprint(String systemFingerprint)
This fingerprint represents the backend configuration that the model runs with.
Can be used in conjunction with the
seed
request parameter to understand when backend changes have been made that might impact determinism.
-
systemFingerprint
final ChatCompletion.Builder systemFingerprint(JsonField<String> systemFingerprint)
Sets Builder.systemFingerprint to an arbitrary JSON value.
You should usually call Builder.systemFingerprint with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
usage
final ChatCompletion.Builder usage(CompletionUsage usage)
Usage statistics for the completion request.
-
usage
final ChatCompletion.Builder usage(JsonField<CompletionUsage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed CompletionUsage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final ChatCompletion.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ChatCompletion.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ChatCompletion.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ChatCompletion.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ChatCompletion.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ChatCompletion build()
Returns an immutable instance of ChatCompletion.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.id() .choices() .created() .model()
-
-
-
-