CodeInterpreterResult.fromJson constructor
Implementation
factory CodeInterpreterResult.fromJson(Map<String, dynamic> json) {
switch (json['type']) {
case 'logs':
return CodeInterpreterLogs(json['logs'] as String);
case 'files':
return CodeInterpreterFiles(
(json['files'] as List).cast<Map<String, dynamic>>().map(CodeInterpreterResultFile.fromJson).toList(),
);
default:
return CodeInterpreterResultOther(json);
}
}