2026-05-23 11:25:18 +02:00
|
|
|
namespace AIStudio.Provider;
|
|
|
|
|
|
2026-10-18 12:06:15 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// What a transcription provider answered.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Success">Whether the provider returned a transcript.</param>
|
|
|
|
|
/// <param name="Text">The transcript.</param>
|
|
|
|
|
/// <param name="ErrorMessage">Why the transcription failed, for the user, when it is known.</param>
|
|
|
|
|
/// <param name="FileRejected">Whether the provider refused the media file itself, so that it would refuse the same file again.</param>
|
|
|
|
|
public sealed record TranscriptionResult(bool Success, string Text, string ErrorMessage = "", bool FileRejected = false)
|
2026-05-23 11:25:18 +02:00
|
|
|
{
|
|
|
|
|
public static TranscriptionResult FromText(string text) => new(true, text);
|
|
|
|
|
|
2026-05-25 17:32:54 +02:00
|
|
|
public static TranscriptionResult Failure(string errorMessage = "") => new(false, string.Empty, errorMessage);
|
2026-10-18 12:06:15 +02:00
|
|
|
|
|
|
|
|
public static TranscriptionResult Rejection(string errorMessage) => new(false, string.Empty, errorMessage, true);
|
2026-05-23 11:25:18 +02:00
|
|
|
}
|