Skip to content

Commit f946acc

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): add new, expressive voices for Realtime and Audio in Chat Completions (#101)
https://platform.openai.com/docs/changelog
1 parent 9336819 commit f946acc

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 68
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-b60d5559d5150ecd3b49136064e5e251d832899770ff385b711378389afba370.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7b0a5d715d94f75ac7795bd4d2175a0e3243af9b935a86c273f371e45583140f.yml

chatcompletion.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ type ChatCompletionAudioParam struct {
454454
// Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,
455455
// or `pcm16`.
456456
Format param.Field[ChatCompletionAudioParamFormat] `json:"format,required"`
457-
// Specifies the voice type. Supported voices are `alloy`, `echo`, `fable`, `onyx`,
458-
// `nova`, and `shimmer`.
457+
// The voice the model uses to respond. Supported voices are `alloy`, `ash`,
458+
// `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
459459
Voice param.Field[ChatCompletionAudioParamVoice] `json:"voice,required"`
460460
}
461461

@@ -483,22 +483,24 @@ func (r ChatCompletionAudioParamFormat) IsKnown() bool {
483483
return false
484484
}
485485

486-
// Specifies the voice type. Supported voices are `alloy`, `echo`, `fable`, `onyx`,
487-
// `nova`, and `shimmer`.
486+
// The voice the model uses to respond. Supported voices are `alloy`, `ash`,
487+
// `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
488488
type ChatCompletionAudioParamVoice string
489489

490490
const (
491491
ChatCompletionAudioParamVoiceAlloy ChatCompletionAudioParamVoice = "alloy"
492+
ChatCompletionAudioParamVoiceAsh ChatCompletionAudioParamVoice = "ash"
493+
ChatCompletionAudioParamVoiceBallad ChatCompletionAudioParamVoice = "ballad"
494+
ChatCompletionAudioParamVoiceCoral ChatCompletionAudioParamVoice = "coral"
492495
ChatCompletionAudioParamVoiceEcho ChatCompletionAudioParamVoice = "echo"
493-
ChatCompletionAudioParamVoiceFable ChatCompletionAudioParamVoice = "fable"
494-
ChatCompletionAudioParamVoiceOnyx ChatCompletionAudioParamVoice = "onyx"
495-
ChatCompletionAudioParamVoiceNova ChatCompletionAudioParamVoice = "nova"
496+
ChatCompletionAudioParamVoiceSage ChatCompletionAudioParamVoice = "sage"
496497
ChatCompletionAudioParamVoiceShimmer ChatCompletionAudioParamVoice = "shimmer"
498+
ChatCompletionAudioParamVoiceVerse ChatCompletionAudioParamVoice = "verse"
497499
)
498500

499501
func (r ChatCompletionAudioParamVoice) IsKnown() bool {
500502
switch r {
501-
case ChatCompletionAudioParamVoiceAlloy, ChatCompletionAudioParamVoiceEcho, ChatCompletionAudioParamVoiceFable, ChatCompletionAudioParamVoiceOnyx, ChatCompletionAudioParamVoiceNova, ChatCompletionAudioParamVoiceShimmer:
503+
case ChatCompletionAudioParamVoiceAlloy, ChatCompletionAudioParamVoiceAsh, ChatCompletionAudioParamVoiceBallad, ChatCompletionAudioParamVoiceCoral, ChatCompletionAudioParamVoiceEcho, ChatCompletionAudioParamVoiceSage, ChatCompletionAudioParamVoiceShimmer, ChatCompletionAudioParamVoiceVerse:
502504
return true
503505
}
504506
return false
@@ -531,7 +533,7 @@ type ChatCompletionChunk struct {
531533
// `stream_options: {"include_usage": true}` in your request. When present, it
532534
// contains a null value except for the last chunk which contains the token usage
533535
// statistics for the entire request.
534-
Usage CompletionUsage `json:"usage"`
536+
Usage CompletionUsage `json:"usage,nullable"`
535537
JSON chatCompletionChunkJSON `json:"-"`
536538
}
537539

0 commit comments

Comments
 (0)