@@ -32,7 +32,7 @@ async fn transcribe_json() -> Result<(), Box<dyn Error>> {
3232 . response_format ( AudioResponseFormat :: Json )
3333 . build ( ) ?;
3434
35- let response = client. audio ( ) . transcribe ( request) . await ?;
35+ let response = client. audio ( ) . transcription ( ) . create ( request) . await ?;
3636 println ! ( "{}" , response. text) ;
3737 Ok ( ( ) )
3838}
@@ -52,7 +52,11 @@ async fn transcribe_verbose_json() -> Result<(), Box<dyn Error>> {
5252 ] )
5353 . build ( ) ?;
5454
55- let response = client. audio ( ) . transcribe_verbose_json ( request) . await ?;
55+ let response = client
56+ . audio ( )
57+ . transcription ( )
58+ . create_verbose_json ( request)
59+ . await ?;
5660
5761 println ! ( "{}" , response. text) ;
5862 if let Some ( words) = & response. words {
@@ -77,7 +81,11 @@ async fn transcribe_diarized_json() -> Result<(), Box<dyn Error>> {
7781 . response_format ( AudioResponseFormat :: DiarizedJson )
7882 . build ( ) ?;
7983
80- let response = client. audio ( ) . transcribe_diarized_json ( request) . await ?;
84+ let response = client
85+ . audio ( )
86+ . transcription ( )
87+ . create_diarized_json ( request)
88+ . await ?;
8189 println ! ( "{:?}" , response) ;
8290 Ok ( ( ) )
8391}
@@ -93,7 +101,7 @@ async fn transcribe_srt() -> Result<(), Box<dyn Error>> {
93101 . response_format ( AudioResponseFormat :: Srt )
94102 . build ( ) ?;
95103
96- let response = client. audio ( ) . transcribe_raw ( request) . await ?;
104+ let response = client. audio ( ) . transcription ( ) . create_raw ( request) . await ?;
97105 println ! ( "{}" , String :: from_utf8_lossy( response. as_ref( ) ) ) ;
98106 Ok ( ( ) )
99107}
@@ -109,7 +117,11 @@ async fn transcribe_stream() -> Result<(), Box<dyn Error>> {
109117 . build ( ) ?;
110118
111119 let mut lock = stdout ( ) . lock ( ) ;
112- let mut response = client. audio ( ) . transcribe_stream ( request) . await ?;
120+ let mut response = client
121+ . audio ( )
122+ . transcription ( )
123+ . create_stream ( request)
124+ . await ?;
113125 while let Some ( event) = response. next ( ) . await {
114126 match event {
115127 Ok ( event) => match event {
0 commit comments