CreateChatCompletionStreamResponse class

Represents a streamed chunk of a chat completion response returned by model, based on the provided input.

Annotations
  • @freezed

Constructors

CreateChatCompletionStreamResponse({@JsonKey(includeIfNull: false) String? id, required 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
const
factory
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 set stream_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

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

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

propertyNames → const List<String>
List of all property names of schema