Skip to content

Commit 939c4cd

Browse files
Add instructions option to speech request (#374)
* Add instructions field to speech request * Update async-openai/src/types/audio.rs * Update openapi.yaml --------- Co-authored-by: Himanshu Neema <[email protected]>
1 parent ef6817f commit 939c4cd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

async-openai/src/types/audio.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,16 @@ pub struct CreateSpeechRequest {
188188
/// One of the available [TTS models](https://platform.openai.com/docs/models/tts): `tts-1` or `tts-1-hd`
189189
pub model: SpeechModel,
190190

191-
/// The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`.
191+
/// The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer` and `verse`.
192+
192193
/// Previews of the voices are available in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
193194
pub voice: Voice,
194195

196+
/// Control the voice of your generated audio with additional instructions.
197+
/// Does not work with `tts-1` or `tts-1-hd`.
198+
#[serde(skip_serializing_if = "Option::is_none")]
199+
pub instructions: Option<String>,
200+
195201
/// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
196202
#[serde(skip_serializing_if = "Option::is_none")]
197203
pub response_format: Option<SpeechResponseFormat>,

0 commit comments

Comments
 (0)