toJson method

  1. @override
Object toJson()
override

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,
    },
  };
}