@@ -12,9 +12,12 @@ pub struct SpeechOptions {
12
12
pub model : String ,
13
13
// The voice to use when generating the audio.
14
14
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 > ,
18
21
#[ serde( flatten) ]
19
22
pub extra : HashMap < String , Value > ,
20
23
}
@@ -27,9 +30,12 @@ pub struct ProcessedSpeechOptions {
27
30
pub model : String ,
28
31
// The voice to use when generating the audio.
29
32
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 > ,
33
39
#[ serde( flatten) ]
34
40
pub extra : HashMap < String , Value > ,
35
41
// One of the available TTS providers.
@@ -43,6 +49,9 @@ pub fn process_speech_options(options: SpeechOptions) -> ProcessedSpeechOptions
43
49
input : options. input ,
44
50
model : vec[ 0 ] . to_string ( ) ,
45
51
voice : options. voice ,
52
+ instructions : options. instructions ,
53
+ response_format : options. response_format ,
54
+ speed : options. speed ,
46
55
extra : options. extra ,
47
56
provider : vec[ 1 ] . to_string ( ) ,
48
57
}
0 commit comments