CodeInterpreterOutput.fromJson constructor
Creates a CodeInterpreterOutput from JSON.
Implementation
factory CodeInterpreterOutput.fromJson(Map<String, dynamic> json) {
final type = json['type'] as String;
return switch (type) {
'logs' => LogsOutput.fromJson(json),
'image' => ImageOutput.fromJson(json),
_ => throw FormatException('Unknown output type: $type'),
};
}