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