toJson method
Convert the Part content to json format.
Implementation
@override
Object toJson() {
final superJson = super.toJson() as Map<String, Object?>;
return <String, Object?>{
...superJson,
'functionCall': {
'name': name,
'args': args,
if (id != null) 'id': id,
},
};
}