-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ShouldSendAudioTranscriptionAsync -> PASS
- Loading branch information
1 parent
e8648a3
commit 23c99ae
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
....AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.Send.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Standard.AI.OpenAI.Tests.Integration/APIs/AudioTranscriptions/AudioTranscriptionsApiTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
Binary file added
BIN
+236 KB
...AI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_15_sec.mp3
Binary file not shown.
Binary file added
BIN
+470 KB
...AI.Tests.Integration/APIs/AudioTranscriptions/assets/OPENAI000_Getting_Started_30_sec.mp3
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters