OpenAIFile.fromJson constructor

OpenAIFile.fromJson(
  1. Map<String, dynamic> j
)

Implementation

factory OpenAIFile.fromJson(Map<String, dynamic> j) => OpenAIFile(
      id: j['id'] as String,
      object: j['object'] as String, // "file"
      bytes: (j['bytes'] as num).toInt(),
      createdAt: (j['created_at'] as num).toInt(),
      filename: j['filename'] as String,
      purpose: FilePurpose.fromJson(j['purpose']), // keep as raw string for forward-compat
    );