-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for audio in chat completions in openai_dart (#577)
- Loading branch information
1 parent
45b9f42
commit 0fb058c
Showing
38 changed files
with
21,565 additions
and
14,753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/openai_dart/lib/src/generated/schema/chat_completion_audio_format.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of open_a_i_schema; | ||
|
||
// ========================================== | ||
// ENUM: ChatCompletionAudioFormat | ||
// ========================================== | ||
|
||
/// Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`. | ||
enum ChatCompletionAudioFormat { | ||
@JsonValue('wav') | ||
wav, | ||
@JsonValue('mp3') | ||
mp3, | ||
@JsonValue('flac') | ||
flac, | ||
@JsonValue('opus') | ||
opus, | ||
@JsonValue('pcm16') | ||
pcm16, | ||
} |
45 changes: 45 additions & 0 deletions
45
packages/openai_dart/lib/src/generated/schema/chat_completion_audio_options.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of open_a_i_schema; | ||
|
||
// ========================================== | ||
// CLASS: ChatCompletionAudioOptions | ||
// ========================================== | ||
|
||
/// Parameters for audio output. Required when audio output is requested with `modalities: ["audio"]`. | ||
/// [Learn more](https://platform.openai.com/docs/guides/audio). | ||
@freezed | ||
class ChatCompletionAudioOptions with _$ChatCompletionAudioOptions { | ||
const ChatCompletionAudioOptions._(); | ||
|
||
/// Factory constructor for ChatCompletionAudioOptions | ||
const factory ChatCompletionAudioOptions({ | ||
/// Specifies the voice type. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. | ||
required ChatCompletionAudioVoice voice, | ||
|
||
/// Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`. | ||
required ChatCompletionAudioFormat format, | ||
}) = _ChatCompletionAudioOptions; | ||
|
||
/// Object construction from a JSON representation | ||
factory ChatCompletionAudioOptions.fromJson(Map<String, dynamic> json) => | ||
_$ChatCompletionAudioOptionsFromJson(json); | ||
|
||
/// List of all property names of schema | ||
static const List<String> propertyNames = ['voice', 'format']; | ||
|
||
/// Perform validations on the schema property values | ||
String? validateSchema() { | ||
return null; | ||
} | ||
|
||
/// Map representation of object (not serialized) | ||
Map<String, dynamic> toMap() { | ||
return { | ||
'voice': voice, | ||
'format': format, | ||
}; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/openai_dart/lib/src/generated/schema/chat_completion_audio_voice.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of open_a_i_schema; | ||
|
||
// ========================================== | ||
// ENUM: ChatCompletionAudioVoice | ||
// ========================================== | ||
|
||
/// Specifies the voice type. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. | ||
enum ChatCompletionAudioVoice { | ||
@JsonValue('alloy') | ||
alloy, | ||
@JsonValue('echo') | ||
echo, | ||
@JsonValue('fable') | ||
fable, | ||
@JsonValue('onyx') | ||
onyx, | ||
@JsonValue('nova') | ||
nova, | ||
@JsonValue('shimmer') | ||
shimmer, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.