Class ChatCompletionChunk.Choice.Builder
-
- All Implemented Interfaces:
public final class ChatCompletionChunk.Choice.Builder
A builder for Choice.
-
-
Method Summary
-
-
Method Detail
-
delta
final ChatCompletionChunk.Choice.Builder delta(ChatCompletionChunk.Choice.Delta delta)
A chat completion delta generated by streamed model responses.
-
delta
final ChatCompletionChunk.Choice.Builder delta(JsonField<ChatCompletionChunk.Choice.Delta> delta)
Sets Builder.delta to an arbitrary JSON value.
You should usually call Builder.delta with a well-typed Delta value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
finishReason
final ChatCompletionChunk.Choice.Builder finishReason(ChatCompletionChunk.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 ChatCompletionChunk.Choice.Builder finishReason(Optional<ChatCompletionChunk.Choice.FinishReason> finishReason)
Alias for calling Builder.finishReason with
finishReason.orElse(null)
.
-
finishReason
final ChatCompletionChunk.Choice.Builder finishReason(JsonField<ChatCompletionChunk.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 ChatCompletionChunk.Choice.Builder index(Long index)
The index of the choice in the list of choices.
-
index
final ChatCompletionChunk.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 ChatCompletionChunk.Choice.Builder logprobs(ChatCompletionChunk.Choice.Logprobs logprobs)
Log probability information for the choice.
-
logprobs
final ChatCompletionChunk.Choice.Builder logprobs(Optional<ChatCompletionChunk.Choice.Logprobs> logprobs)
Alias for calling Builder.logprobs with
logprobs.orElse(null)
.
-
logprobs
final ChatCompletionChunk.Choice.Builder logprobs(JsonField<ChatCompletionChunk.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.
-
additionalProperties
final ChatCompletionChunk.Choice.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ChatCompletionChunk.Choice.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ChatCompletionChunk.Choice.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ChatCompletionChunk.Choice.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ChatCompletionChunk.Choice.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ChatCompletionChunk.Choice build()
Returns an immutable instance of Choice.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.delta() .finishReason() .index()
-
-
-
-