CreateChatCompletionStreamResponse class abstract
Represents a streamed chunk of a chat completion response returned by model, based on the provided input.
- Available extensions
- Annotations
-
- @freezed
Constructors
-
CreateChatCompletionStreamResponse.new({@JsonKey(includeIfNull: false) String? id, @JsonKey(includeIfNull: false) List<
ChatCompletionStreamResponseChoice> ? choices, @JsonKey(includeIfNull: false) int? created, @JsonKey(includeIfNull: false) String? model, @JsonKey(name: 'service_tier', includeIfNull: false, unknownEnumValue: JsonKey.nullForUndefinedEnumValue) ServiceTier? serviceTier, @JsonKey(name: 'system_fingerprint', includeIfNull: false) String? systemFingerprint, @JsonKey(includeIfNull: false) String? object, @JsonKey(includeIfNull: false) CompletionUsage? usage}) -
Factory constructor for CreateChatCompletionStreamResponse
constfactory
-
CreateChatCompletionStreamResponse.fromJson(Map<
String, dynamic> json) -
Object construction from a JSON representation
factory
Properties
-
choices
→ List<
ChatCompletionStreamResponseChoice> ? -
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}
.no setterinherited -
copyWith
→ $CreateChatCompletionStreamResponseCopyWith<
CreateChatCompletionStreamResponse> -
Create a copy of CreateChatCompletionStreamResponse
with the given fields replaced by the non-null parameter values.
no setterinherited
- created → int?
-
The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
A unique identifier for the chat completion. Each chunk has the same ID.
no setterinherited
- model → String?
-
The model to generate the completion.
no setterinherited
- object → String?
-
The object type, which is always
chat.completion.chunk
.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceTier → ServiceTier?
-
The service tier used for processing the request. This field is only included if the
service_tier
parameter is specified in the request.no setterinherited - systemFingerprint → String?
-
This fingerprint represents the backend configuration that the model runs with.
no setterinherited
- usage → CompletionUsage?
-
Usage statistics for the completion request.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_CreateChatCompletionStreamResponse value)) → TResult -
Available on CreateChatCompletionStreamResponse, provided by the CreateChatCompletionStreamResponsePatterns extension
Aswitch
-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_CreateChatCompletionStreamResponse value)?) → TResult? -
Available on CreateChatCompletionStreamResponse, provided by the CreateChatCompletionStreamResponsePatterns extension
A variant ofmap
that fallback to returningnull
. -
maybeMap<
TResult extends Object?> (TResult $default(_CreateChatCompletionStreamResponse value)?, {required TResult orElse()}) → TResult -
Available on CreateChatCompletionStreamResponse, provided by the CreateChatCompletionStreamResponsePatterns extension
A variant ofmap
that fallback to returningorElse
. -
maybeWhen<
TResult extends Object?> (TResult $default(String? id, List< ChatCompletionStreamResponseChoice> ? choices, int? created, String? model, ServiceTier? serviceTier, String? systemFingerprint, String? object, CompletionUsage? usage)?, {required TResult orElse()}) → TResult -
Available on CreateChatCompletionStreamResponse, provided by the CreateChatCompletionStreamResponsePatterns extension
A variant ofwhen
that fallback to anorElse
callback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this CreateChatCompletionStreamResponse to a JSON map.
inherited
-
toMap(
) → Map< String, dynamic> - Map representation of object (not serialized)
-
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
) → String? - Perform validations on the schema property values
-
when<
TResult extends Object?> (TResult $default(String? id, List< ChatCompletionStreamResponseChoice> ? choices, int? created, String? model, ServiceTier? serviceTier, String? systemFingerprint, String? object, CompletionUsage? usage)) → TResult -
Available on CreateChatCompletionStreamResponse, provided by the CreateChatCompletionStreamResponsePatterns extension
Aswitch
-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String? id, List< ChatCompletionStreamResponseChoice> ? choices, int? created, String? model, ServiceTier? serviceTier, String? systemFingerprint, String? object, CompletionUsage? usage)?) → TResult? -
Available on CreateChatCompletionStreamResponse, provided by the CreateChatCompletionStreamResponsePatterns extension
A variant ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
propertyNames
→ const List<
String> - List of all property names of schema