OpenAIChatCompletionModel class final

This class represents the chat completion response model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.

Annotations
  • @immutable

Constructors

OpenAIChatCompletionModel({required String id, required DateTime created, required List<OpenAIChatCompletionChoiceModel> choices, required OpenAIChatCompletionUsageModel usage})
This class represents the chat completion response model of the OpenAI API, which is used and get returned while using the OpenAIChat methods.
const
OpenAIChatCompletionModel.fromMap(Map<String, dynamic> json)
This is used to convert a Map<String, dynamic> object to a OpenAIChatCompletionModel object.
factory

Properties

choices List<OpenAIChatCompletionChoiceModel>
The choices of the chat completion.
final
created DateTime
The date and time when the chat completion is created.
final
hashCode int
The hash code for this object.
no setteroverride
haveChoices bool
Weither the chat completion have at least one choice in choices.
no setter
id String
The id of the chat completion.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
usage OpenAIChatCompletionUsageModel
The usage of the chat completion.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
This is used to convert a OpenAIChatCompletionModel object to a Map<String, dynamic> object.
toString() String
A string representation of this object.
override

Operators

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