Class ChatCompletion.Choice
-
- All Implemented Interfaces:
public final class ChatCompletion.Choice
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ChatCompletion.Choice.Builder
A builder for Choice.
public final class
ChatCompletion.Choice.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.public final class
ChatCompletion.Choice.Logprobs
Log probability information for the choice.
-
Method Summary
Modifier and Type Method Description final ChatCompletion.Choice.FinishReason
finishReason()
The reason the model stopped generating tokens. final Long
index()
The index of the choice in the list of choices. final Optional<ChatCompletion.Choice.Logprobs>
logprobs()
Log probability information for the choice. final ChatCompletionMessage
message()
A chat completion message generated by the model. final JsonField<ChatCompletion.Choice.FinishReason>
_finishReason()
Returns the raw JSON value of finishReason. final JsonField<Long>
_index()
Returns the raw JSON value of index. final JsonField<ChatCompletion.Choice.Logprobs>
_logprobs()
Returns the raw JSON value of logprobs. final JsonField<ChatCompletionMessage>
_message()
Returns the raw JSON value of message. final Map<String, JsonValue>
_additionalProperties()
final ChatCompletion.Choice.Builder
toBuilder()
final ChatCompletion.Choice
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ChatCompletion.Choice.Builder
builder()
Returns a mutable builder for constructing an instance of Choice. -
-
Method Detail
-
finishReason
final 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.
-
logprobs
final Optional<ChatCompletion.Choice.Logprobs> logprobs()
Log probability information for the choice.
-
message
final ChatCompletionMessage message()
A chat completion message generated by the model.
-
_finishReason
final JsonField<ChatCompletion.Choice.FinishReason> _finishReason()
Returns the raw JSON value of finishReason.
Unlike finishReason, this method doesn't throw if the JSON field has an unexpected type.
-
_index
final JsonField<Long> _index()
Returns the raw JSON value of index.
Unlike index, this method doesn't throw if the JSON field has an unexpected type.
-
_logprobs
final JsonField<ChatCompletion.Choice.Logprobs> _logprobs()
Returns the raw JSON value of logprobs.
Unlike logprobs, this method doesn't throw if the JSON field has an unexpected type.
-
_message
final JsonField<ChatCompletionMessage> _message()
Returns the raw JSON value of message.
Unlike message, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ChatCompletion.Choice.Builder toBuilder()
-
validate
final ChatCompletion.Choice validate()
-
builder
final static ChatCompletion.Choice.Builder builder()
Returns a mutable builder for constructing an instance of Choice.
The following fields are required:
.finishReason() .index() .logprobs() .message()
-
-
-
-