11using Microsoft . ClientModel . TestFramework ;
22using NUnit . Framework ;
33using OpenAI . Audio ;
4+ using OpenAI . Tests . Utility ;
45using System ;
56using System . ClientModel ;
67using System . ClientModel . Primitives ;
@@ -14,7 +15,7 @@ namespace OpenAI.Tests.Audio;
1415
1516[ Parallelizable ( ParallelScope . All ) ]
1617[ Category ( "Audio" ) ]
17- public partial class TranscriptionTests : ClientTestBase
18+ public partial class TranscriptionTests : OpenAIRecordedTestBase
1819{
1920 public TranscriptionTests ( bool isAsync ) : base ( isAsync )
2021 {
@@ -31,7 +32,7 @@ public enum AudioSourceKind
3132 [ TestCase ( AudioSourceKind . UsingFilePath ) ]
3233 public async Task TranscriptionWorks ( AudioSourceKind audioSourceKind )
3334 {
34- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Whisper ) ) ;
35+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Whisper ) ;
3536 string filename = "audio_hello_world.mp3" ;
3637 string path = Path . Combine ( "Assets" , filename ) ;
3738 AudioTranscription transcription = null ;
@@ -58,7 +59,7 @@ public async Task TranscriptionWorks(AudioSourceKind audioSourceKind)
5859 [ TestCase ( AudioTimestampGranularities . Word | AudioTimestampGranularities . Segment ) ]
5960 public async Task TimestampsWork ( AudioTimestampGranularities granularityFlags )
6061 {
61- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Whisper ) ) ;
62+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Whisper ) ;
6263
6364 using FileStream inputStream = File . OpenRead ( Path . Combine ( "Assets" , "audio_hello_world.mp3" ) ) ;
6465
@@ -131,7 +132,7 @@ public async Task TimestampsWork(AudioTimestampGranularities granularityFlags)
131132 [ TestCase ( null ) ]
132133 public async Task TranscriptionFormatsWork ( string responseFormat )
133134 {
134- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Whisper ) ) ;
135+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Whisper ) ;
135136 string path = Path . Combine ( "Assets" , "audio_hello_world.mp3" ) ;
136137
137138 AudioTranscriptionOptions options = new ( )
@@ -188,7 +189,7 @@ public async Task TranscriptionFormatsWork(string responseFormat)
188189 [ Test ]
189190 public async Task IncludesWork ( )
190191 {
191- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Gpt_4o_Mini_Transcribe ) ) ;
192+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Gpt_4o_Mini_Transcribe ) ;
192193 string filename = "audio_hello_world.mp3" ;
193194 string path = Path . Combine ( "Assets" , filename ) ;
194195
@@ -206,7 +207,7 @@ public async Task IncludesWork()
206207 [ Test ]
207208 public async Task StreamingIncludesWork ( )
208209 {
209- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Gpt_4o_Mini_Transcribe ) ) ;
210+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Gpt_4o_Mini_Transcribe ) ;
210211 string filename = "audio_hello_world.mp3" ;
211212 string path = Path . Combine ( "Assets" , filename ) ;
212213
@@ -240,7 +241,7 @@ in client.TranscribeAudioStreamingAsync(
240241 [ Test ]
241242 public async Task BadTranscriptionRequest ( )
242243 {
243- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Whisper ) ) ;
244+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Whisper ) ;
244245
245246 string path = Path . Combine ( "Assets" , "audio_hello_world.mp3" ) ;
246247
@@ -269,7 +270,7 @@ public async Task BadTranscriptionRequest()
269270 [ TestCase ( AudioSourceKind . UsingFilePath ) ]
270271 public async Task StreamingTranscriptionWorks ( AudioSourceKind audioSourceKind )
271272 {
272- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Gpt_4o_Mini_Transcribe ) ) ;
273+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Gpt_4o_Mini_Transcribe ) ;
273274 string filename = "audio_hello_world.mp3" ;
274275 string path = Path . Combine ( "Assets" , filename ) ;
275276
@@ -314,7 +315,7 @@ public async Task StreamingTranscriptionWorks(AudioSourceKind audioSourceKind)
314315 [ TestCase ( AudioSourceKind . UsingFilePath ) ]
315316 public void StreamingTranscriptionThrowsForWhisperModel ( AudioSourceKind audioSourceKind )
316317 {
317- AudioClient client = CreateProxyFromClient ( GetTestClient < AudioClient > ( TestScenario . Audio_Whisper ) ) ;
318+ AudioClient client = GetProxiedOpenAIClient < AudioClient > ( TestScenario . Audio_Whisper ) ;
318319 string filename = "audio_hello_world.mp3" ;
319320 string path = Path . Combine ( "Assets" , filename ) ;
320321
0 commit comments