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"),
84 references to TextToSpeechResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (42)
Generated\361d1da7f942c932\JsonContext.TextToSpeechResponseUpdate.g.cs (3)
53
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>
68
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextToSpeechResponseUpdate).GetProperty("Kind", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
), global::System.Array.Empty<global::System.Type>(), null),
71
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>(options, info0);
Generated\361d1da7f942c932\JsonContext.TextToSpeechResponseUpdateKind.g.cs (10)
15
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>? _TextToSpeechResponseUpdateKind;
21
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> TextToSpeechResponseUpdateKind
24
get => _TextToSpeechResponseUpdateKind ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
));
27
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> Create_TextToSpeechResponseUpdateKind(global::System.Text.Json.JsonSerializerOptions options)
29
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> jsonTypeInfo))
31
global::System.Text.Json.Serialization.JsonConverter converter = ExpandConverter(typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
), new global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
.Converter(), options);
32
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> (options, converter);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
340
if (type == typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
))
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 (34)
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
342
if (type == typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
))
Generated\361d1da7f942c932\TestJsonSerializerContext.TextToSpeechResponseUpdate.g.cs (3)
51
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>
66
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.TextToSpeechResponseUpdate).GetProperty("Kind", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
), global::System.Array.Empty<global::System.Type>(), null),
69
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>(options, info0);
Generated\361d1da7f942c932\TestJsonSerializerContext.TextToSpeechResponseUpdateKind.g.cs (10)
13
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>? _TextToSpeechResponseUpdateKind;
19
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> TextToSpeechResponseUpdateKind
22
get => _TextToSpeechResponseUpdateKind ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
));
25
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> Create_TextToSpeechResponseUpdateKind(global::System.Text.Json.JsonSerializerOptions options)
27
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> jsonTypeInfo))
29
global::System.Text.Json.Serialization.JsonConverter converter = ExpandConverter(typeof(global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
), new global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
.Converter(), options);
30
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::Microsoft.Extensions.AI.
TextToSpeechResponseUpdateKind
> (options, converter);
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);