17 instantiations of SpeechToTextResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (6)
SpeechToText\SpeechToTextResponseUpdateKind.cs (6)
22public static SpeechToTextResponseUpdateKind SessionOpen { get; } = new("sessionopen"); 25public static SpeechToTextResponseUpdateKind Error { get; } = new("error"); 28public static SpeechToTextResponseUpdateKind TextUpdating { get; } = new("textupdating"); 31public static SpeechToTextResponseUpdateKind TextUpdated { get; } = new("textupdated"); 34public static SpeechToTextResponseUpdateKind SessionClose { get; } = new("sessionclose"); 99new(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"), 87Kind = new SpeechToTextResponseUpdateKind("transcribed"),
49 references to SpeechToTextResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (28)
SpeechToText\SpeechToTextResponse.cs (1)
91Kind = SpeechToTextResponseUpdateKind.TextUpdated,
SpeechToText\SpeechToTextResponseUpdate.cs (2)
58public SpeechToTextResponseUpdateKind Kind { get; set; } = SpeechToTextResponseUpdateKind.TextUpdating;
SpeechToText\SpeechToTextResponseUpdateKind.cs (25)
19public readonly struct SpeechToTextResponseUpdateKind : IEquatable<SpeechToTextResponseUpdateKind> 22public static SpeechToTextResponseUpdateKind SessionOpen { get; } = new("sessionopen"); 25public static SpeechToTextResponseUpdateKind Error { get; } = new("error"); 28public static SpeechToTextResponseUpdateKind TextUpdating { get; } = new("textupdating"); 31public static SpeechToTextResponseUpdateKind TextUpdated { get; } = new("textupdated"); 34public static SpeechToTextResponseUpdateKind SessionClose { get; } = new("sessionclose"); 37/// Gets the value associated with this <see cref="SpeechToTextResponseUpdateKind"/>. 45/// Initializes a new instance of the <see cref="SpeechToTextResponseUpdateKind"/> struct with the provided value. 47/// <param name="value">The value to associate with this <see cref="SpeechToTextResponseUpdateKind"/>.</param> 55/// Returns a value indicating whether two <see cref="SpeechToTextResponseUpdateKind"/> instances are equivalent, as determined by a 58/// <param name="left">The first <see cref="SpeechToTextResponseUpdateKind"/> instance to compare.</param> 59/// <param name="right">The second <see cref="SpeechToTextResponseUpdateKind"/> instance to compare.</param> 61public static bool operator ==(SpeechToTextResponseUpdateKind left, SpeechToTextResponseUpdateKind right) 67/// Returns a value indicating whether two <see cref="SpeechToTextResponseUpdateKind"/> instances are not equivalent, as determined by a 70/// <param name="left">The first <see cref="SpeechToTextResponseUpdateKind"/> instance to compare. </param> 71/// <param name="right">The second <see cref="SpeechToTextResponseUpdateKind"/> instance to compare. </param> 73public static bool operator !=(SpeechToTextResponseUpdateKind left, SpeechToTextResponseUpdateKind right) 80=> obj is SpeechToTextResponseUpdateKind otherRole && Equals(otherRole); 83public bool Equals(SpeechToTextResponseUpdateKind other) 93/// <summary>Provides a <see cref="JsonConverter{T}"/> for serializing <see cref="SpeechToTextResponseUpdateKind"/> instances.</summary> 95public sealed class Converter : JsonConverter<SpeechToTextResponseUpdateKind> 98public override SpeechToTextResponseUpdateKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => 102public override void Write(Utf8JsonWriter writer, SpeechToTextResponseUpdateKind value, JsonSerializerOptions options)
Microsoft.Extensions.AI.Abstractions.Tests (19)
SpeechToText\SpeechToTextResponseTests.cs (1)
231Assert.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))]
Microsoft.Extensions.AI.OpenAI (2)
OpenAISpeechToTextClient.cs (2)
144result.Kind = SpeechToTextResponseUpdateKind.TextUpdated; 149result.Kind = SpeechToTextResponseUpdateKind.SessionClose;