Skip to content

Commit bd200d2

Browse files
committed
chore: update
1 parent 18bbb9c commit bd200d2

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

crates/provider_openai/src/speech.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ pub async fn handle(
1515
"input": options.input,
1616
"model": options.model,
1717
"voice": options.voice,
18+
"instructions": options.instructions,
19+
"response_format": options.response_format,
20+
"speed": options.speed,
1821
});
1922

2023
let res = client.post("https://api.openai.com/v1/audio/speech")

crates/shared/src/speech.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ pub struct SpeechOptions {
1212
pub model: String,
1313
// The voice to use when generating the audio.
1414
pub voice: String,
15-
// instructions
16-
// response_format
17-
// speed
15+
// Control the voice of your generated audio with additional instructions.
16+
pub instructions: Option<String>,
17+
// The format to audio in.
18+
pub response_format: Option<String>,
19+
// The speed of the generated audio.
20+
pub speed: Option<f32>,
1821
#[serde(flatten)]
1922
pub extra: HashMap<String, Value>,
2023
}
@@ -27,9 +30,12 @@ pub struct ProcessedSpeechOptions {
2730
pub model: String,
2831
// The voice to use when generating the audio.
2932
pub voice: String,
30-
// instructions
31-
// response_format
32-
// speed
33+
// Control the voice of your generated audio with additional instructions.
34+
pub instructions: Option<String>,
35+
// The format to audio in.
36+
pub response_format: Option<String>,
37+
// The speed of the generated audio.
38+
pub speed: Option<f32>,
3339
#[serde(flatten)]
3440
pub extra: HashMap<String, Value>,
3541
// One of the available TTS providers.
@@ -43,6 +49,9 @@ pub fn process_speech_options(options: SpeechOptions) -> ProcessedSpeechOptions
4349
input: options.input,
4450
model: vec[0].to_string(),
4551
voice: options.voice,
52+
instructions: options.instructions,
53+
response_format: options.response_format,
54+
speed: options.speed,
4655
extra: options.extra,
4756
provider: vec[1].to_string(),
4857
}

0 commit comments

Comments
 (0)