OpenAIStreamChatCompletionChoiceModel.fromMap constructor

OpenAIStreamChatCompletionChoiceModel.fromMap(
  1. Map<String, dynamic> json
)

The OpenAIStreamChatCompletionChoiceModel class represents the chat completion choice response model of the OpenAI API, which is used and get returned while using the chat methods that leverages Stream functionality.

Implementation

factory OpenAIStreamChatCompletionChoiceModel.fromMap(
  Map<String, dynamic> json,
) {
  return OpenAIStreamChatCompletionChoiceModel(
    index: json['index'],
    delta: OpenAIStreamChatCompletionChoiceDeltaModel.fromMap(json['delta']),
    finishReason: json['finish_reason'],
  );
}