toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final result = <String, dynamic>{
    'model': model,
    'role': role,
    'content': content.toJson(),
  };
  if (stopReason != null) {
    result['stopReason'] = stopReason;
  }
  return result;
}