Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/AssemblyAI.IntegrationTests/AudioIntelligenceTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using AssemblyAI.Transcripts;

namespace AssemblyAI.IntegrationTests;

[TestFixture]
public class AudioIntelligenceTests
{
private const string RemoteAudioUrl = "https://assembly.ai/espn.m4a";

[Test]
public async Task ShouldReturnContentSafety()
{
var client = Helpers.CreateClient();

var transcript = await client.Transcripts.TranscribeAsync(new TranscriptParams
{
AudioUrl = RemoteAudioUrl,
ContentSafety = true,
ContentSafetyConfidence = 50,
}
).ConfigureAwait(false);

Assert.That(transcript, Is.Not.Null);
Assert.Multiple(() =>
{
Assert.That(transcript.Id, Is.Not.Null);
Assert.That(transcript.Text, Is.Not.Empty);
Assert.That(transcript.Status, Is.EqualTo(TranscriptStatus.Completed));
Assert.That(transcript.ContentSafetyLabels, Is.Not.Null);
Assert.Multiple(() =>
{
Assert.That(
transcript.ContentSafetyLabels!.Status,
Is.EqualTo(AudioIntelligenceModelStatus.Success)
);
Assert.That(
transcript.ContentSafetyLabels!.Results,
Is.Not.Empty
);
var result = transcript.ContentSafetyLabels!.Results.First();
Assert.That(result.Text, Is.Not.Empty);
Assert.That(result.Labels, Is.Not.Empty);
}
);
});
}
}
2 changes: 1 addition & 1 deletion src/AssemblyAI/Transcripts/Types/ContentSafetyLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public record ContentSafetyLabel
/// How severely the topic is discussed in the section, from 0 to 1
/// </summary>
[JsonPropertyName("severity")]
public required double Severity { get; set; }
public required double? Severity { get; set; }

public override string ToString()
{
Expand Down
Loading