OpenAIFileModel.fromMap constructor

OpenAIFileModel.fromMap(
  1. Map<String, dynamic> map
)

This class is used to represent an OpenAI file. This method is used to convert a Map<String, dynamic> object to a OpenAIFileModel object.

Implementation

factory OpenAIFileModel.fromMap(Map<String, dynamic> map) {
  return OpenAIFileModel(
    id: map['id'] as String,
    bytes: map['bytes'] as int,
    createdAt: DateTime.fromMillisecondsSinceEpoch(map['created_at'] as int),
    fileName: map['filename'] as String,
    purpose: map['purpose'] as String,
  );
}