Class Completion.Builder
-
- All Implemented Interfaces:
public final class Completion.BuilderA builder for Completion.
-
-
Method Summary
Modifier and Type Method Description final Completion.Builderid(String id)Unique object identifier. final Completion.Builderid(JsonField<String> id)Sets Builder.id to an arbitrary JSON value. final Completion.Buildercompletion(String completion)The resulting completion up to and excluding the stop sequences. final Completion.Buildercompletion(JsonField<String> completion)Sets Builder.completion to an arbitrary JSON value. final Completion.Buildermodel(Model model)The model that will complete your prompt. final Completion.Buildermodel(JsonField<Model> model)Sets Builder.model to an arbitrary JSON value. final Completion.Buildermodel(String value)Sets model to an arbitrary String. final Completion.BuilderstopReason(String stopReason)The reason that we stopped. final Completion.BuilderstopReason(Optional<String> stopReason)Alias for calling Builder.stopReason with stopReason.orElse(null).final Completion.BuilderstopReason(JsonField<String> stopReason)Sets Builder.stopReason to an arbitrary JSON value. final Completion.Buildertype(JsonValue type)Sets the field to an arbitrary JSON value. final Completion.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final Completion.BuilderputAdditionalProperty(String key, JsonValue value)final Completion.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final Completion.BuilderremoveAdditionalProperty(String key)final Completion.BuilderremoveAllAdditionalProperties(Set<String> keys)final Completionbuild()Returns an immutable instance of Completion. -
-
Method Detail
-
id
final Completion.Builder id(String id)
Unique object identifier.
The format and length of IDs may change over time.
-
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.
-
completion
final Completion.Builder completion(String completion)
The resulting completion up to and excluding the stop sequences.
-
completion
final Completion.Builder completion(JsonField<String> completion)
Sets Builder.completion to an arbitrary JSON value.
You should usually call Builder.completion with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final Completion.Builder model(Model model)
The model that will complete your prompt.\n\nSee models for additional details and options.
-
model
final Completion.Builder model(JsonField<Model> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed Model value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final Completion.Builder model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed Model constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
stopReason
final Completion.Builder stopReason(String stopReason)
The reason that we stopped.
This may be one the following values:
"stop_sequence": we reached a stop sequence — either provided by you via thestop_sequencesparameter, or a stop sequence built into the model"max_tokens": we exceededmax_tokens_to_sampleor the model's maximum
-
stopReason
final Completion.Builder stopReason(Optional<String> stopReason)
Alias for calling Builder.stopReason with
stopReason.orElse(null).
-
stopReason
final Completion.Builder stopReason(JsonField<String> stopReason)
Sets Builder.stopReason to an arbitrary JSON value.
You should usually call Builder.stopReason with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final Completion.Builder type(JsonValue type)
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("completion")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() .completion() .model() .stopReason()
-
-
-
-