STTRequest.fromJson constructor

STTRequest.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory STTRequest.fromJson(Map<String, dynamic> json) => STTRequest(
      audioData: json['audio_data'] != null
          ? List<int>.from(json['audio_data'] as List)
          : null,
      filePath: json['file_path'] as String?,
      cloudStorageUrl: json['cloud_storage_url'] as String?,
      model: json['model'] as String?,
      language: json['language'] as String?,
      format: json['format'] as String?,
      includeWordTiming: json['include_word_timing'] as bool? ?? false,
      includeConfidence: json['include_confidence'] as bool? ?? false,
      temperature: json['temperature'] as double?,
      timestampGranularity: TimestampGranularity.values.firstWhere(
        (e) => e.name == json['timestamp_granularity'],
        orElse: () => TimestampGranularity.word,
      ),
      diarize: json['diarize'] as bool? ?? false,
      numSpeakers: json['num_speakers'] as int?,
      tagAudioEvents: json['tag_audio_events'] as bool? ?? true,
      webhook: json['webhook'] as bool? ?? false,
      prompt: json['prompt'] as String?,
      responseFormat: json['response_format'] as String?,
      enableLogging: json['enable_logging'] as bool? ?? true,
    );