Class ChatCompletionChunk.Builder
-
- All Implemented Interfaces:
public final class ChatCompletionChunk.Builder
A builder for ChatCompletionChunk.
-
-
Method Summary
Modifier and Type Method Description final ChatCompletionChunk.Builder
id(String id)
A unique identifier for the chat completion. final ChatCompletionChunk.Builder
id(JsonField<String> id)
A unique identifier for the chat completion. final ChatCompletionChunk.Builder
choices(List<ChatCompletionChunk.Choice> choices)
A list of chat completion choices. final ChatCompletionChunk.Builder
choices(JsonField<List<ChatCompletionChunk.Choice>> choices)
A list of chat completion choices. final ChatCompletionChunk.Builder
addChoice(ChatCompletionChunk.Choice choice)
A list of chat completion choices. final ChatCompletionChunk.Builder
created(Long created)
The Unix timestamp (in seconds) of when the chat completion was created. final ChatCompletionChunk.Builder
created(JsonField<Long> created)
The Unix timestamp (in seconds) of when the chat completion was created. final ChatCompletionChunk.Builder
model(String model)
The model to generate the completion. final ChatCompletionChunk.Builder
model(JsonField<String> model)
The model to generate the completion. final ChatCompletionChunk.Builder
object_(JsonValue object_)
The object type, which is always chat.completion.chunk
.final ChatCompletionChunk.Builder
serviceTier(ChatCompletionChunk.ServiceTier serviceTier)
The service tier used for processing the request. final ChatCompletionChunk.Builder
serviceTier(Optional<ChatCompletionChunk.ServiceTier> serviceTier)
The service tier used for processing the request. final ChatCompletionChunk.Builder
serviceTier(JsonField<ChatCompletionChunk.ServiceTier> serviceTier)
The service tier used for processing the request. final ChatCompletionChunk.Builder
systemFingerprint(String systemFingerprint)
This fingerprint represents the backend configuration that the model runs with. final ChatCompletionChunk.Builder
systemFingerprint(JsonField<String> systemFingerprint)
This fingerprint represents the backend configuration that the model runs with. final ChatCompletionChunk.Builder
usage(CompletionUsage usage)
An optional field that will only be present when you set stream_options: {"include_usage": true}
in your request.final ChatCompletionChunk.Builder
usage(Optional<CompletionUsage> usage)
An optional field that will only be present when you set stream_options: {"include_usage": true}
in your request.final ChatCompletionChunk.Builder
usage(JsonField<CompletionUsage> usage)
An optional field that will only be present when you set stream_options: {"include_usage": true}
in your request.final ChatCompletionChunk.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final ChatCompletionChunk.Builder
putAdditionalProperty(String key, JsonValue value)
final ChatCompletionChunk.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final ChatCompletionChunk.Builder
removeAdditionalProperty(String key)
final ChatCompletionChunk.Builder
removeAllAdditionalProperties(Set<String> keys)
final ChatCompletionChunk
build()
-
-
Method Detail
-
id
final ChatCompletionChunk.Builder id(String id)
A unique identifier for the chat completion. Each chunk has the same ID.
-
id
final ChatCompletionChunk.Builder id(JsonField<String> id)
A unique identifier for the chat completion. Each chunk has the same ID.
-
choices
final ChatCompletionChunk.Builder choices(List<ChatCompletionChunk.Choice> choices)
A list of chat completion choices. Can contain more than one elements if
n
is greater than 1. Can also be empty for the last chunk if you setstream_options: {"include_usage": true}
.
-
choices
final ChatCompletionChunk.Builder choices(JsonField<List<ChatCompletionChunk.Choice>> choices)
A list of chat completion choices. Can contain more than one elements if
n
is greater than 1. Can also be empty for the last chunk if you setstream_options: {"include_usage": true}
.
-
addChoice
final ChatCompletionChunk.Builder addChoice(ChatCompletionChunk.Choice choice)
A list of chat completion choices. Can contain more than one elements if
n
is greater than 1. Can also be empty for the last chunk if you setstream_options: {"include_usage": true}
.
-
created
final ChatCompletionChunk.Builder created(Long created)
The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
-
created
final ChatCompletionChunk.Builder created(JsonField<Long> created)
The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
-
model
final ChatCompletionChunk.Builder model(String model)
The model to generate the completion.
-
model
final ChatCompletionChunk.Builder model(JsonField<String> model)
The model to generate the completion.
-
object_
final ChatCompletionChunk.Builder object_(JsonValue object_)
The object type, which is always
chat.completion.chunk
.
-
serviceTier
final ChatCompletionChunk.Builder serviceTier(ChatCompletionChunk.ServiceTier serviceTier)
The service tier used for processing the request.
-
serviceTier
final ChatCompletionChunk.Builder serviceTier(Optional<ChatCompletionChunk.ServiceTier> serviceTier)
The service tier used for processing the request.
-
serviceTier
final ChatCompletionChunk.Builder serviceTier(JsonField<ChatCompletionChunk.ServiceTier> serviceTier)
The service tier used for processing the request.
-
systemFingerprint
final ChatCompletionChunk.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 ChatCompletionChunk.Builder systemFingerprint(JsonField<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.
-
usage
final ChatCompletionChunk.Builder usage(CompletionUsage usage)
An optional field that will only be present when you set
stream_options: {"include_usage": true}
in your request. When present, it contains a null value except for the last chunk which contains the token usage statistics for the entire request.
-
usage
final ChatCompletionChunk.Builder usage(Optional<CompletionUsage> usage)
An optional field that will only be present when you set
stream_options: {"include_usage": true}
in your request. When present, it contains a null value except for the last chunk which contains the token usage statistics for the entire request.
-
usage
final ChatCompletionChunk.Builder usage(JsonField<CompletionUsage> usage)
An optional field that will only be present when you set
stream_options: {"include_usage": true}
in your request. When present, it contains a null value except for the last chunk which contains the token usage statistics for the entire request.
-
additionalProperties
final ChatCompletionChunk.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ChatCompletionChunk.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ChatCompletionChunk.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ChatCompletionChunk.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ChatCompletionChunk.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ChatCompletionChunk build()
-
-
-
-