Public Access
Add meeting assistant speech and summary automation
This commit is contained in:
@@ -23,7 +23,7 @@ public sealed class AzureSpeechStreamingTranscriptionProviderTests
|
||||
|
||||
var exception = await Assert.ThrowsAsync<InvalidOperationException>(async () =>
|
||||
{
|
||||
await foreach (var _ in provider.TranscribeAsync(ReadSingleChunk(), CancellationToken.None))
|
||||
await foreach (var _ in provider.TranscribeAsync(ReadSingleChunk(), SpeechRecognitionPipelineOptions.Default, CancellationToken.None))
|
||||
{
|
||||
}
|
||||
});
|
||||
@@ -31,6 +31,78 @@ public sealed class AzureSpeechStreamingTranscriptionProviderTests
|
||||
Assert.Contains("Azure Speech key is not configured", exception.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AutoDetectLanguagesAreUsedOnlyWhenLanguageIsAuto()
|
||||
{
|
||||
Assert.Equal(
|
||||
["de-DE", "en-US"],
|
||||
AzureSpeechStreamingTranscriptionProvider.GetAutoDetectLanguages(new AzureSpeechOptions
|
||||
{
|
||||
Language = "auto",
|
||||
AutoDetectLanguages = ["de-DE", "en-US", "de-DE", " "]
|
||||
}));
|
||||
|
||||
Assert.Empty(AzureSpeechStreamingTranscriptionProvider.GetAutoDetectLanguages(new AzureSpeechOptions
|
||||
{
|
||||
Language = "de-DE",
|
||||
AutoDetectLanguages = ["de-DE", "en-US"]
|
||||
}));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NormalizeDictationWordsTrimsAndDeduplicatesPhrases()
|
||||
{
|
||||
Assert.Equal(
|
||||
["PBI", "Product Backlog Item"],
|
||||
AzureSpeechStreamingTranscriptionProvider.NormalizeDictationWords([
|
||||
" PBI ",
|
||||
"pbi",
|
||||
"",
|
||||
"Product Backlog Item"
|
||||
]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResolveKeyFallsBackToUserEnvironment()
|
||||
{
|
||||
var keyEnv = $"MEETING_ASSISTANT_AZURE_KEY_{Guid.NewGuid():N}";
|
||||
try
|
||||
{
|
||||
Environment.SetEnvironmentVariable(keyEnv, "user-key", EnvironmentVariableTarget.User);
|
||||
|
||||
Assert.Equal("user-key", AzureSpeechStreamingTranscriptionProvider.ResolveKey(new AzureSpeechOptions
|
||||
{
|
||||
KeyEnv = keyEnv
|
||||
}));
|
||||
}
|
||||
finally
|
||||
{
|
||||
Environment.SetEnvironmentVariable(keyEnv, null, EnvironmentVariableTarget.User);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EndpointDefaultsToUniversalV2SpeechEndpointForRegion()
|
||||
{
|
||||
Assert.Equal(
|
||||
new Uri("wss://germanywestcentral.stt.speech.microsoft.com/speech/universal/v2"),
|
||||
AzureSpeechStreamingTranscriptionProvider.GetEndpoint(new AzureSpeechOptions
|
||||
{
|
||||
Endpoint = "",
|
||||
Region = "germanywestcentral"
|
||||
}));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null, "Continuous")]
|
||||
[InlineData("", "Continuous")]
|
||||
[InlineData("continuous", "Continuous")]
|
||||
[InlineData("AtStart", "AtStart")]
|
||||
public void LanguageIdModeDefaultsToContinuous(string? configured, string expected)
|
||||
{
|
||||
Assert.Equal(expected, AzureSpeechStreamingTranscriptionProvider.NormalizeLanguageIdMode(configured));
|
||||
}
|
||||
|
||||
private static async IAsyncEnumerable<AudioChunk> ReadSingleChunk()
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
Reference in New Issue
Block a user