toJson method
Implementation
Map<String, dynamic> toJson() => {
if (modalities != null) "modalities": modalities!.map((e) => e.toJson()).toList(),
if (model != null) 'model': model?.toJson(),
if (instructions != null) 'instructions': instructions,
if (voice != null) 'voice': voice!.toJson(),
if (inputAudioFormat != null) 'input_audio_format': inputAudioFormat!.toJson(),
if (outputAudioFormat != null) 'output_audio_format': outputAudioFormat!.toJson(),
if (inputAudioTranscription != null) 'input_audio_transcription': inputAudioTranscription!.toJson(),
if (turnDetection != null) 'turn_detection': turnDetection == null ? null : turnDetection!.toJson(),
if (tools != null) 'tools': tools!.map((t) => t.toJson()).toList(),
if (toolChoice != null) 'tool_choice': toolChoice!.toJson(),
if (temperature != null) 'temperature': temperature,
if (maxResponseOutputTokens != null) 'max_response_output_tokens': maxResponseOutputTokens,
if (speed != null) 'speed': speed,
if (tracing != null) 'tracing': tracing?.toJson(),
if (clientSecret != null) 'client_secret': clientSecret!.toJson(),
};