Class ChatCompletion.Choice.Builder
-
- All Implemented Interfaces:
public final class ChatCompletion.Choice.Builder
A builder for Choice.
-
-
Method Summary
-
-
Method Detail
-
finishReason
final ChatCompletion.Choice.Builder finishReason(ChatCompletion.Choice.FinishReason finishReason)
The reason the model stopped generating tokens. This will be
stop
if the model hit a natural stop point or a provided stop sequence,length
if the maximum number of tokens specified in the request was reached,content_filter
if content was omitted due to a flag from our content filters,tool_calls
if the model called a tool, orfunction_call
(deprecated) if the model called a function.
-
finishReason
final ChatCompletion.Choice.Builder finishReason(JsonField<ChatCompletion.Choice.FinishReason> finishReason)
Sets Builder.finishReason to an arbitrary JSON value.
You should usually call Builder.finishReason with a well-typed FinishReason value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
index
final ChatCompletion.Choice.Builder index(Long index)
The index of the choice in the list of choices.
-
index
final ChatCompletion.Choice.Builder index(JsonField<Long> index)
Sets Builder.index to an arbitrary JSON value.
You should usually call Builder.index with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
logprobs
final ChatCompletion.Choice.Builder logprobs(ChatCompletion.Choice.Logprobs logprobs)
Log probability information for the choice.
-
logprobs
final ChatCompletion.Choice.Builder logprobs(Optional<ChatCompletion.Choice.Logprobs> logprobs)
Alias for calling Builder.logprobs with
logprobs.orElse(null)
.
-
logprobs
final ChatCompletion.Choice.Builder logprobs(JsonField<ChatCompletion.Choice.Logprobs> logprobs)
Sets Builder.logprobs to an arbitrary JSON value.
You should usually call Builder.logprobs with a well-typed Logprobs value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
message
final ChatCompletion.Choice.Builder message(ChatCompletionMessage message)
A chat completion message generated by the model.
-
message
final ChatCompletion.Choice.Builder message(JsonField<ChatCompletionMessage> message)
Sets Builder.message to an arbitrary JSON value.
You should usually call Builder.message with a well-typed ChatCompletionMessage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final ChatCompletion.Choice.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ChatCompletion.Choice.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ChatCompletion.Choice.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ChatCompletion.Choice.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ChatCompletion.Choice.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ChatCompletion.Choice build()
Returns an immutable instance of Choice.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.finishReason() .index() .logprobs() .message()
-
-
-
-