17 instantiations of TextToSpeechResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (6)
TextToSpeech\TextToSpeechResponseUpdateKind.cs (6)
22
public static TextToSpeechResponseUpdateKind SessionOpen { get; } =
new
("sessionopen");
25
public static TextToSpeechResponseUpdateKind Error { get; } =
new
("error");
28
public static TextToSpeechResponseUpdateKind AudioUpdating { get; } =
new
("audioupdating");
31
public static TextToSpeechResponseUpdateKind AudioUpdated { get; } =
new
("audioupdated");
34
public static TextToSpeechResponseUpdateKind SessionClose { get; } =
new
("sessionclose");
99
new
(reader.GetString()!);
Microsoft.Extensions.AI.Abstractions.Tests (11)
TextToSpeech\TextToSpeechResponseUpdateKindTests.cs (9)
15
Assert.Equal("abc", new
TextToSpeechResponseUpdateKind
("abc").Value);
21
Assert.Throws<ArgumentNullException>("value", () => new
TextToSpeechResponseUpdateKind
(null!));
22
Assert.Throws<ArgumentException>("value", () => new
TextToSpeechResponseUpdateKind
(" "));
28
var kind1 = new
TextToSpeechResponseUpdateKind
("abc");
29
var kind2 = new
TextToSpeechResponseUpdateKind
("ABC");
35
var kind3 = new
TextToSpeechResponseUpdateKind
("def");
41
Assert.Equal(kind1.GetHashCode(), new
TextToSpeechResponseUpdateKind
("abc").GetHashCode());
42
Assert.Equal(kind1.GetHashCode(), new
TextToSpeechResponseUpdateKind
("ABC").GetHashCode());
58
var kind = new
TextToSpeechResponseUpdateKind
("abc");
TextToSpeech\TextToSpeechResponseUpdateTests.cs (2)
27
Kind = new
TextToSpeechResponseUpdateKind
("custom"),
49
Kind = new
TextToSpeechResponseUpdateKind
("audiogenerated"),
56 references to TextToSpeechResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (28)
TextToSpeech\TextToSpeechResponse.cs (1)
62
Kind =
TextToSpeechResponseUpdateKind
.AudioUpdated,
TextToSpeech\TextToSpeechResponseUpdate.cs (2)
48
public
TextToSpeechResponseUpdateKind
Kind { get; set; } =
TextToSpeechResponseUpdateKind
.AudioUpdating;
TextToSpeech\TextToSpeechResponseUpdateKind.cs (25)
19
public readonly struct TextToSpeechResponseUpdateKind : IEquatable<
TextToSpeechResponseUpdateKind
>
22
public static
TextToSpeechResponseUpdateKind
SessionOpen { get; } = new("sessionopen");
25
public static
TextToSpeechResponseUpdateKind
Error { get; } = new("error");
28
public static
TextToSpeechResponseUpdateKind
AudioUpdating { get; } = new("audioupdating");
31
public static
TextToSpeechResponseUpdateKind
AudioUpdated { get; } = new("audioupdated");
34
public static
TextToSpeechResponseUpdateKind
SessionClose { get; } = new("sessionclose");
37
/// Gets the value associated with this <see cref="
TextToSpeechResponseUpdateKind
"/>.
45
/// Initializes a new instance of the <see cref="
TextToSpeechResponseUpdateKind
"/> struct with the provided value.
47
/// <param name="value">The value to associate with this <see cref="
TextToSpeechResponseUpdateKind
"/>.</param>
55
/// Returns a value indicating whether two <see cref="
TextToSpeechResponseUpdateKind
"/> instances are equivalent, as determined by a
58
/// <param name="left">The first <see cref="
TextToSpeechResponseUpdateKind
"/> instance to compare.</param>
59
/// <param name="right">The second <see cref="
TextToSpeechResponseUpdateKind
"/> instance to compare.</param>
61
public static bool operator ==(
TextToSpeechResponseUpdateKind
left,
TextToSpeechResponseUpdateKind
right)
67
/// Returns a value indicating whether two <see cref="
TextToSpeechResponseUpdateKind
"/> instances are not equivalent, as determined by a
70
/// <param name="left">The first <see cref="
TextToSpeechResponseUpdateKind
"/> instance to compare. </param>
71
/// <param name="right">The second <see cref="
TextToSpeechResponseUpdateKind
"/> instance to compare. </param>
73
public static bool operator !=(
TextToSpeechResponseUpdateKind
left,
TextToSpeechResponseUpdateKind
right)
80
=> obj is
TextToSpeechResponseUpdateKind
otherKind && Equals(otherKind);
83
public bool Equals(
TextToSpeechResponseUpdateKind
other)
93
/// <summary>Provides a <see cref="JsonConverter{T}"/> for serializing <see cref="
TextToSpeechResponseUpdateKind
"/> instances.</summary>
95
public sealed class Converter : JsonConverter<
TextToSpeechResponseUpdateKind
>
98
public override
TextToSpeechResponseUpdateKind
Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
102
public override void Write(Utf8JsonWriter writer,
TextToSpeechResponseUpdateKind
value, JsonSerializerOptions options)
Microsoft.Extensions.AI.Abstractions.Tests (20)
TestJsonSerializerContext.cs (1)
25
[JsonSerializable(typeof(
TextToSpeechResponseUpdateKind
))]
TextToSpeech\TextToSpeechResponseTests.cs (1)
160
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdated, update.Kind);
TextToSpeech\TextToSpeechResponseUpdateKindTests.cs (16)
28
var
kind1 = new TextToSpeechResponseUpdateKind("abc");
29
var
kind2 = new TextToSpeechResponseUpdateKind("ABC");
35
var
kind3 = new TextToSpeechResponseUpdateKind("def");
48
Assert.Equal(
TextToSpeechResponseUpdateKind
.SessionOpen.ToString(),
TextToSpeechResponseUpdateKind
.SessionOpen.Value);
49
Assert.Equal(
TextToSpeechResponseUpdateKind
.Error.ToString(),
TextToSpeechResponseUpdateKind
.Error.Value);
50
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdating.ToString(),
TextToSpeechResponseUpdateKind
.AudioUpdating.Value);
51
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdated.ToString(),
TextToSpeechResponseUpdateKind
.AudioUpdated.Value);
52
Assert.Equal(
TextToSpeechResponseUpdateKind
.SessionClose.ToString(),
TextToSpeechResponseUpdateKind
.SessionClose.Value);
58
var
kind = new TextToSpeechResponseUpdateKind("abc");
62
var
result = JsonSerializer.Deserialize<
TextToSpeechResponseUpdateKind
>(json, TestJsonSerializerContext.Default.TextToSpeechResponseUpdateKind);
TextToSpeech\TextToSpeechResponseUpdateTests.cs (2)
17
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdating, update.Kind);
89
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdated, result.Kind);
Microsoft.Extensions.AI.OpenAI (2)
OpenAITextToSpeechClient.cs (2)
120
Kind =
TextToSpeechResponseUpdateKind
.AudioUpdating,
130
Kind =
TextToSpeechResponseUpdateKind
.SessionClose,
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAITextToSpeechClientIntegrationTests.cs (2)
38
if (update.Kind ==
TextToSpeechResponseUpdateKind
.AudioUpdating)
45
else if (update.Kind ==
TextToSpeechResponseUpdateKind
.SessionClose)
OpenAITextToSpeechClientTests.cs (4)
271
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdated, update.Kind);
319
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdating, updates[0].Kind);
327
Assert.Equal(
TextToSpeechResponseUpdateKind
.AudioUpdating, updates[1].Kind);
334
Assert.Equal(
TextToSpeechResponseUpdateKind
.SessionClose, updates[2].Kind);