diff --git a/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.Send.cs b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.Send.cs new file mode 100644 index 00000000..7649728e --- /dev/null +++ b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.Send.cs @@ -0,0 +1,38 @@ +// ---------------------------------------------------------------------------------- +// Copyright (c) The Standard Organization, a coalition of the Good-Hearted Engineers +// ---------------------------------------------------------------------------------- + +using System.Threading.Tasks; +using Standard.AI.OpenAI.Models.Services.Foundations.AudioTranscriptions; +using Xunit; + +namespace Standard.AI.OpenAI.Tests.Integration.APIs.AudioTranscriptions +{ + public partial class AudioTranscriptionsApiTests + { + [Theory(Skip = "This test is only for releases")] + [InlineData(@"APIs\AudioTranscriptions\assets\OPENAI000_Getting_Started_15_sec.mp3")] + [InlineData(@"APIs\AudioTranscriptions\assets\OPENAI000_Getting_Started_30_sec.mp3")] + public async Task ShouldSendAudioTranscriptionAsync(string filePath) + { + // given + var inputAudioTranscription = new AudioTranscription + { + Request = new AudioTranscriptionRequest + { + Model = AudioTranscriptionModel.Whisper1, + FilePath = filePath + } + }; + + // when + AudioTranscription responseAudioTranscription = + await this.openAIClient.AudioTranscriptions.SendAudioTranscriptionAsync( + inputAudioTranscription); + + // then + Assert.NotNull(responseAudioTranscription.Response); + Assert.NotNull(responseAudioTranscription.Response.Text); + } + } +} \ No newline at end of file diff --git a/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.cs b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.cs new file mode 100644 index 00000000..d93f8ff4 --- /dev/null +++ b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.cs @@ -0,0 +1,27 @@ +// ---------------------------------------------------------------------------------- +// Copyright (c) The Standard Organization, a coalition of the Good-Hearted Engineers +// ---------------------------------------------------------------------------------- + +using System; +using Standard.AI.OpenAI.Clients.OpenAIs; +using Standard.AI.OpenAI.Models.Configurations; + +namespace Standard.AI.OpenAI.Tests.Integration.APIs.AudioTranscriptions +{ + public partial class AudioTranscriptionsApiTests + { + private readonly IOpenAIClient openAIClient; + + public AudioTranscriptionsApiTests() + { + var openAIConfigurations = new OpenAIConfigurations + { + ApiKey = Environment.GetEnvironmentVariable("ApiKey"), + OrganizationId = Environment.GetEnvironmentVariable("OrgId"), + ApiUrl = "https://api.openai.com/" + }; + + this.openAIClient = new OpenAIClient(openAIConfigurations); + } + } +} diff --git a/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_15_sec.mp3 b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_15_sec.mp3 new file mode 100644 index 00000000..d851792a Binary files /dev/null and b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_15_sec.mp3 differ diff --git a/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_30_sec.mp3 b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_30_sec.mp3 new file mode 100644 index 00000000..ec7448ce Binary files /dev/null and b/Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_30_sec.mp3 differ diff --git a/Standard.AI.OpenAI.Tests.Integration/Standard.AI.OpenAI.Tests.Integration.csproj b/Standard.AI.OpenAI.Tests.Integration/Standard.AI.OpenAI.Tests.Integration.csproj index 3d2a2330..4a4e81d7 100644 --- a/Standard.AI.OpenAI.Tests.Integration/Standard.AI.OpenAI.Tests.Integration.csproj +++ b/Standard.AI.OpenAI.Tests.Integration/Standard.AI.OpenAI.Tests.Integration.csproj @@ -21,6 +21,10 @@ + + + +