Class Completion.Builder
-
- All Implemented Interfaces:
public final class Completion.Builder
A builder for Completion.
-
-
Method Summary
Modifier and Type Method Description final Completion.Builder
id(String id)
A unique identifier for the completion. final Completion.Builder
id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value. final Completion.Builder
choices(List<CompletionChoice> choices)
The list of completion choices the model generated for the input prompt. final Completion.Builder
choices(JsonField<List<CompletionChoice>> choices)
Sets Builder.choices to an arbitrary JSON value. final Completion.Builder
addChoice(CompletionChoice choice)
Adds a single CompletionChoice to choices. final Completion.Builder
created(Long created)
The Unix timestamp (in seconds) of when the completion was created. final Completion.Builder
created(JsonField<Long> created)
Sets Builder.created to an arbitrary JSON value. final Completion.Builder
model(String model)
The model used for completion. final Completion.Builder
model(JsonField<String> model)
Sets Builder.model to an arbitrary JSON value. final Completion.Builder
object_(JsonValue object_)
Sets the field to an arbitrary JSON value. final Completion.Builder
systemFingerprint(String systemFingerprint)
This fingerprint represents the backend configuration that the model runs with. final Completion.Builder
systemFingerprint(JsonField<String> systemFingerprint)
Sets Builder.systemFingerprint to an arbitrary JSON value. final Completion.Builder
usage(CompletionUsage usage)
Usage statistics for the completion request. final Completion.Builder
usage(JsonField<CompletionUsage> usage)
Sets Builder.usage to an arbitrary JSON value. final Completion.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final Completion.Builder
putAdditionalProperty(String key, JsonValue value)
final Completion.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final Completion.Builder
removeAdditionalProperty(String key)
final Completion.Builder
removeAllAdditionalProperties(Set<String> keys)
final Completion
build()
Returns an immutable instance of Completion. -
-
Method Detail
-
id
final Completion.Builder id(String id)
A unique identifier for the completion.
-
id
final Completion.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 Completion.Builder choices(List<CompletionChoice> choices)
The list of completion choices the model generated for the input prompt.
-
choices
final Completion.Builder choices(JsonField<List<CompletionChoice>> choices)
Sets Builder.choices to an arbitrary JSON value.
You should usually call Builder.choices with a well-typed
List<CompletionChoice>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addChoice
final Completion.Builder addChoice(CompletionChoice choice)
Adds a single CompletionChoice to choices.
-
created
final Completion.Builder created(Long created)
The Unix timestamp (in seconds) of when the completion was created.
-
created
final Completion.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 Completion.Builder model(String model)
The model used for completion.
-
model
final Completion.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 Completion.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("text_completion")
This method is primarily for setting the field to an undocumented or not yet supported value.
-
systemFingerprint
final Completion.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 Completion.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 Completion.Builder usage(CompletionUsage usage)
Usage statistics for the completion request.
-
usage
final Completion.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 Completion.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final Completion.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final Completion.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final Completion.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final Completion.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final Completion build()
Returns an immutable instance of Completion.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.id() .choices() .created() .model()
-
-
-
-