From 9027f605cd93a360c8b19c1e244c69712aa6fd3c Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Wed, 30 Oct 2024 16:11:51 +0000 Subject: [PATCH] feat(api): add new, expressive voices for Realtime and Audio in Chat Completions https://platform.openai.com/docs/changelog --- .stats.yml | 2 +- chatcompletion.go | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0b087255..39413df4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 68 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-b60d5559d5150ecd3b49136064e5e251d832899770ff385b711378389afba370.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7b0a5d715d94f75ac7795bd4d2175a0e3243af9b935a86c273f371e45583140f.yml diff --git a/chatcompletion.go b/chatcompletion.go index 229e9dba..43318abc 100644 --- a/chatcompletion.go +++ b/chatcompletion.go @@ -383,8 +383,8 @@ type ChatCompletionAudioParam struct { // Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, // or `pcm16`. Format param.Field[ChatCompletionAudioParamFormat] `json:"format,required"` - // Specifies the voice type. Supported voices are `alloy`, `echo`, `fable`, `onyx`, - // `nova`, and `shimmer`. + // The voice the model uses to respond. Supported voices are `alloy`, `ash`, + // `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`. Voice param.Field[ChatCompletionAudioParamVoice] `json:"voice,required"` } @@ -412,22 +412,24 @@ func (r ChatCompletionAudioParamFormat) IsKnown() bool { return false } -// Specifies the voice type. Supported voices are `alloy`, `echo`, `fable`, `onyx`, -// `nova`, and `shimmer`. +// The voice the model uses to respond. Supported voices are `alloy`, `ash`, +// `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`. type ChatCompletionAudioParamVoice string const ( ChatCompletionAudioParamVoiceAlloy ChatCompletionAudioParamVoice = "alloy" + ChatCompletionAudioParamVoiceAsh ChatCompletionAudioParamVoice = "ash" + ChatCompletionAudioParamVoiceBallad ChatCompletionAudioParamVoice = "ballad" + ChatCompletionAudioParamVoiceCoral ChatCompletionAudioParamVoice = "coral" ChatCompletionAudioParamVoiceEcho ChatCompletionAudioParamVoice = "echo" - ChatCompletionAudioParamVoiceFable ChatCompletionAudioParamVoice = "fable" - ChatCompletionAudioParamVoiceOnyx ChatCompletionAudioParamVoice = "onyx" - ChatCompletionAudioParamVoiceNova ChatCompletionAudioParamVoice = "nova" + ChatCompletionAudioParamVoiceSage ChatCompletionAudioParamVoice = "sage" ChatCompletionAudioParamVoiceShimmer ChatCompletionAudioParamVoice = "shimmer" + ChatCompletionAudioParamVoiceVerse ChatCompletionAudioParamVoice = "verse" ) func (r ChatCompletionAudioParamVoice) IsKnown() bool { switch r { - case ChatCompletionAudioParamVoiceAlloy, ChatCompletionAudioParamVoiceEcho, ChatCompletionAudioParamVoiceFable, ChatCompletionAudioParamVoiceOnyx, ChatCompletionAudioParamVoiceNova, ChatCompletionAudioParamVoiceShimmer: + case ChatCompletionAudioParamVoiceAlloy, ChatCompletionAudioParamVoiceAsh, ChatCompletionAudioParamVoiceBallad, ChatCompletionAudioParamVoiceCoral, ChatCompletionAudioParamVoiceEcho, ChatCompletionAudioParamVoiceSage, ChatCompletionAudioParamVoiceShimmer, ChatCompletionAudioParamVoiceVerse: return true } return false @@ -460,7 +462,7 @@ type ChatCompletionChunk struct { // `stream_options: {"include_usage": true}` in your request. When present, it // contains a null value except for the last chunk which contains the token usage // statistics for the entire request. - Usage CompletionUsage `json:"usage"` + Usage CompletionUsage `json:"usage,nullable"` JSON chatCompletionChunkJSON `json:"-"` }