CreateChatCompletionResponse class

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

Annotations
  • @freezed

Constructors

CreateChatCompletionResponse({@JsonKey(includeIfNull: false) String? id, required List<ChatCompletionResponseChoice> choices, required int created, required String model, @JsonKey(name: 'service_tier', includeIfNull: false, unknownEnumValue: JsonKey.nullForUndefinedEnumValue) ServiceTier? serviceTier, @JsonKey(name: 'system_fingerprint', includeIfNull: false) String? systemFingerprint, required String object, @JsonKey(includeIfNull: false) CompletionUsage? usage})
Factory constructor for CreateChatCompletionResponse
const
factory
CreateChatCompletionResponse.fromJson(Map<String, dynamic> json)
Object construction from a JSON representation
factory

Properties

choices List<ChatCompletionResponseChoice>
A list of chat completion choices. Can be more than one if n is greater than 1.
no setterinherited
copyWith → $CreateChatCompletionResponseCopyWith<CreateChatCompletionResponse>
Create a copy of CreateChatCompletionResponse 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.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String?
A unique identifier for the chat completion.
no setterinherited
model String
The model used for the chat completion.
no setterinherited
object String
The object type, which is always chat.completion.
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 CreateChatCompletionResponse 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