RealtimeTranslationOutputTranscriptDeltaEvent.fromJson constructor
Creates from JSON.
Implementation
factory RealtimeTranslationOutputTranscriptDeltaEvent.fromJson(
Map<String, dynamic> json,
) {
if (json['type'] != 'session.output_transcript.delta') {
throw FormatException(
'RealtimeTranslationOutputTranscriptDeltaEvent.fromJson expected type '
'"session.output_transcript.delta", got ${json['type']}',
);
}
return RealtimeTranslationOutputTranscriptDeltaEvent(
eventId: json['event_id'] as String,
delta: json['delta'] as String,
elapsedMs: json['elapsed_ms'] as int?,
);
}