Class ChatCompletionStreamOptions
-
- All Implemented Interfaces:
public final class ChatCompletionStreamOptions
Options for streaming response. Only set this when you set
stream: true
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ChatCompletionStreamOptions.Builder
A builder for ChatCompletionStreamOptions.
-
Method Summary
Modifier and Type Method Description final Optional<Boolean>
includeUsage()
If set, an additional chunk will be streamed before the data: [DONE]
message.final JsonField<Boolean>
_includeUsage()
Returns the raw JSON value of includeUsage. final Map<String, JsonValue>
_additionalProperties()
final ChatCompletionStreamOptions
validate()
final ChatCompletionStreamOptions.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ChatCompletionStreamOptions.Builder
builder()
Returns a mutable builder for constructing an instance of ChatCompletionStreamOptions. -
-
Method Detail
-
includeUsage
final Optional<Boolean> includeUsage()
If set, an additional chunk will be streamed before the
data: [DONE]
message. Theusage
field on this chunk shows the token usage statistics for the entire request, and thechoices
field will always be an empty array.All other chunks will also include a
usage
field, but with a null value. NOTE: If the stream is interrupted, you may not receive the final usage chunk which contains the total token usage for the request.
-
_includeUsage
final JsonField<Boolean> _includeUsage()
Returns the raw JSON value of includeUsage.
Unlike includeUsage, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
validate
final ChatCompletionStreamOptions validate()
-
toBuilder
final ChatCompletionStreamOptions.Builder toBuilder()
-
builder
final static ChatCompletionStreamOptions.Builder builder()
Returns a mutable builder for constructing an instance of ChatCompletionStreamOptions.
-
-
-
-