ChatAudioConfig class
Configuration for audio output in chat completions.
Used with gpt-audio-1.5 to configure how audio responses
are generated.
Example
final request = ChatCompletionCreateRequest(
model: 'gpt-audio-1.5',
messages: [ChatMessage.user('Tell me a story.')],
modalities: [ChatModality.text, ChatModality.audio],
audio: ChatAudioConfig(
voice: ChatAudioVoice.alloy,
format: ChatAudioFormat.mp3,
),
);
- Annotations
-
- @immutable
Constructors
- ChatAudioConfig({required ChatAudioVoice voice, required ChatAudioFormat format})
-
Creates a ChatAudioConfig.
const
-
ChatAudioConfig.fromJson(Map<
String, dynamic> json) -
Creates a ChatAudioConfig from JSON.
factory
Properties
- format → ChatAudioFormat
-
The audio format to output.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- voice → ChatAudioVoice
-
The voice to use for audio generation.
final
Methods
-
copyWith(
{ChatAudioVoice? voice, ChatAudioFormat? format}) → ChatAudioConfig - Creates a copy with replaced values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override