17 instantiations of SpeechToTextResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (6)
SpeechToText\SpeechToTextResponseUpdateKind.cs (6)
21public static SpeechToTextResponseUpdateKind SessionOpen { get; } = new("sessionopen"); 24public static SpeechToTextResponseUpdateKind Error { get; } = new("error"); 27public static SpeechToTextResponseUpdateKind TextUpdating { get; } = new("textupdating"); 30public static SpeechToTextResponseUpdateKind TextUpdated { get; } = new("textupdated"); 33public static SpeechToTextResponseUpdateKind SessionClose { get; } = new("sessionclose"); 98new(reader.GetString()!);
Microsoft.Extensions.AI.Abstractions.Tests (11)
SpeechToText\SpeechToTextResponseUpdateKindTests.cs (9)
15Assert.Equal("abc", new SpeechToTextResponseUpdateKind("abc").Value); 21Assert.Throws<ArgumentNullException>("value", () => new SpeechToTextResponseUpdateKind(null!)); 22Assert.Throws<ArgumentException>("value", () => new SpeechToTextResponseUpdateKind(" ")); 28var kind1 = new SpeechToTextResponseUpdateKind("abc"); 29var kind2 = new SpeechToTextResponseUpdateKind("ABC"); 35var kind3 = new SpeechToTextResponseUpdateKind("def"); 41Assert.Equal(kind1.GetHashCode(), new SpeechToTextResponseUpdateKind("abc").GetHashCode()); 42Assert.Equal(kind1.GetHashCode(), new SpeechToTextResponseUpdateKind("ABC").GetHashCode()); 58var kind = new SpeechToTextResponseUpdateKind("abc");
SpeechToText\SpeechToTextResponseUpdateTests.cs (2)
32Kind = new SpeechToTextResponseUpdateKind("custom"), 88Kind = new SpeechToTextResponseUpdateKind("transcribed"),
47 references to SpeechToTextResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (28)
SpeechToText\SpeechToTextResponse.cs (1)
86Kind = SpeechToTextResponseUpdateKind.TextUpdated,
SpeechToText\SpeechToTextResponseUpdate.cs (2)
59public SpeechToTextResponseUpdateKind Kind { get; set; } = SpeechToTextResponseUpdateKind.TextUpdating;
SpeechToText\SpeechToTextResponseUpdateKind.cs (25)
18public readonly struct SpeechToTextResponseUpdateKind : IEquatable<SpeechToTextResponseUpdateKind> 21public static SpeechToTextResponseUpdateKind SessionOpen { get; } = new("sessionopen"); 24public static SpeechToTextResponseUpdateKind Error { get; } = new("error"); 27public static SpeechToTextResponseUpdateKind TextUpdating { get; } = new("textupdating"); 30public static SpeechToTextResponseUpdateKind TextUpdated { get; } = new("textupdated"); 33public static SpeechToTextResponseUpdateKind SessionClose { get; } = new("sessionclose"); 36/// Gets the value associated with this <see cref="SpeechToTextResponseUpdateKind"/>. 44/// Initializes a new instance of the <see cref="SpeechToTextResponseUpdateKind"/> struct with the provided value. 46/// <param name="value">The value to associate with this <see cref="SpeechToTextResponseUpdateKind"/>.</param> 54/// Returns a value indicating whether two <see cref="SpeechToTextResponseUpdateKind"/> instances are equivalent, as determined by a 57/// <param name="left">The first <see cref="SpeechToTextResponseUpdateKind"/> instance to compare.</param> 58/// <param name="right">The second <see cref="SpeechToTextResponseUpdateKind"/> instance to compare.</param> 60public static bool operator ==(SpeechToTextResponseUpdateKind left, SpeechToTextResponseUpdateKind right) 66/// Returns a value indicating whether two <see cref="SpeechToTextResponseUpdateKind"/> instances are not equivalent, as determined by a 69/// <param name="left">The first <see cref="SpeechToTextResponseUpdateKind"/> instance to compare. </param> 70/// <param name="right">The second <see cref="SpeechToTextResponseUpdateKind"/> instance to compare. </param> 72public static bool operator !=(SpeechToTextResponseUpdateKind left, SpeechToTextResponseUpdateKind right) 79=> obj is SpeechToTextResponseUpdateKind otherRole && Equals(otherRole); 82public bool Equals(SpeechToTextResponseUpdateKind other) 92/// <summary>Provides a <see cref="JsonConverter{T}"/> for serializing <see cref="SpeechToTextResponseUpdateKind"/> instances.</summary> 94public sealed class Converter : JsonConverter<SpeechToTextResponseUpdateKind> 97public override SpeechToTextResponseUpdateKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => 101public override void Write(Utf8JsonWriter writer, SpeechToTextResponseUpdateKind value, JsonSerializerOptions options)
Microsoft.Extensions.AI.Abstractions.Tests (19)
SpeechToText\SpeechToTextResponseTests.cs (1)
216Assert.Equal(SpeechToTextResponseUpdateKind.TextUpdated, update.Kind);
SpeechToText\SpeechToTextResponseUpdateKindTests.cs (16)
28var kind1 = new SpeechToTextResponseUpdateKind("abc"); 29var kind2 = new SpeechToTextResponseUpdateKind("ABC"); 35var kind3 = new SpeechToTextResponseUpdateKind("def"); 48Assert.Equal(SpeechToTextResponseUpdateKind.SessionOpen.ToString(), SpeechToTextResponseUpdateKind.SessionOpen.Value); 49Assert.Equal(SpeechToTextResponseUpdateKind.Error.ToString(), SpeechToTextResponseUpdateKind.Error.Value); 50Assert.Equal(SpeechToTextResponseUpdateKind.TextUpdating.ToString(), SpeechToTextResponseUpdateKind.TextUpdating.Value); 51Assert.Equal(SpeechToTextResponseUpdateKind.TextUpdated.ToString(), SpeechToTextResponseUpdateKind.TextUpdated.Value); 52Assert.Equal(SpeechToTextResponseUpdateKind.SessionClose.ToString(), SpeechToTextResponseUpdateKind.SessionClose.Value); 58var kind = new SpeechToTextResponseUpdateKind("abc"); 62var result = JsonSerializer.Deserialize<SpeechToTextResponseUpdateKind>(json, TestJsonSerializerContext.Default.SpeechToTextResponseUpdateKind);
SpeechToText\SpeechToTextResponseUpdateTests.cs (1)
18Assert.Equal(SpeechToTextResponseUpdateKind.TextUpdating, update.Kind);
TestJsonSerializerContext.cs (1)
21[JsonSerializable(typeof(SpeechToTextResponseUpdateKind))]