OpenAIAudioModel.fromMap constructor

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

This is used to convert a Map<String, dynamic> object to a OpenAIAudioModel object.

Implementation

factory OpenAIAudioModel.fromMap(Map<String, dynamic> json) {
  return OpenAIAudioModel(
    text: json['text'],
    task: json['task'],
    language: json['language'],
    duration: json['duration'],
    words: json['words'] != null
        ? List<Word>.from(json['words'].map((x) => Word.fromMap(x)))
        : null,
    segments: json['segments'] != null
        ? List<Segment>.from(json['segments'].map((x) => Segment.fromMap(x)))
        : null,
  );
}