17 instantiations of SpeechToTextResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (6)
SpeechToText\SpeechToTextResponseUpdateKind.cs (6)
22
public static SpeechToTextResponseUpdateKind SessionOpen { get; } =
new
("sessionopen");
25
public static SpeechToTextResponseUpdateKind Error { get; } =
new
("error");
28
public static SpeechToTextResponseUpdateKind TextUpdating { get; } =
new
("textupdating");
31
public static SpeechToTextResponseUpdateKind TextUpdated { get; } =
new
("textupdated");
34
public static SpeechToTextResponseUpdateKind SessionClose { get; } =
new
("sessionclose");
99
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"),
87
Kind = new
SpeechToTextResponseUpdateKind
("transcribed"),
82 references to SpeechToTextResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (42)
Generated\361d1da7f942c932\JsonContext.SpeechToTextResponseUpdate.g.cs (3)
53
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>
68
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponseUpdate).GetProperty("Kind", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
), global::System.Array.Empty<global::System.Type>(), null),
71
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>(options, info0);
Generated\361d1da7f942c932\JsonContext.SpeechToTextResponseUpdateKind.g.cs (10)
15
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>? _SpeechToTextResponseUpdateKind;
21
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> SpeechToTextResponseUpdateKind
24
get => _SpeechToTextResponseUpdateKind ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
));
27
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> Create_SpeechToTextResponseUpdateKind(global::System.Text.Json.JsonSerializerOptions options)
29
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> jsonTypeInfo))
31
global::System.Text.Json.Serialization.JsonConverter converter = ExpandConverter(typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
), new global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
.Converter(), options);
32
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> (options, converter);
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
308
if (type == typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
))
SpeechToText\SpeechToTextResponse.cs (1)
91
Kind =
SpeechToTextResponseUpdateKind
.TextUpdated,
SpeechToText\SpeechToTextResponseUpdate.cs (2)
58
public
SpeechToTextResponseUpdateKind
Kind { get; set; } =
SpeechToTextResponseUpdateKind
.TextUpdating;
SpeechToText\SpeechToTextResponseUpdateKind.cs (25)
19
public readonly struct SpeechToTextResponseUpdateKind : IEquatable<
SpeechToTextResponseUpdateKind
>
22
public static
SpeechToTextResponseUpdateKind
SessionOpen { get; } = new("sessionopen");
25
public static
SpeechToTextResponseUpdateKind
Error { get; } = new("error");
28
public static
SpeechToTextResponseUpdateKind
TextUpdating { get; } = new("textupdating");
31
public static
SpeechToTextResponseUpdateKind
TextUpdated { get; } = new("textupdated");
34
public 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>
61
public 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>
73
public static bool operator !=(
SpeechToTextResponseUpdateKind
left,
SpeechToTextResponseUpdateKind
right)
80
=> obj is
SpeechToTextResponseUpdateKind
otherRole && Equals(otherRole);
83
public bool Equals(
SpeechToTextResponseUpdateKind
other)
93
/// <summary>Provides a <see cref="JsonConverter{T}"/> for serializing <see cref="
SpeechToTextResponseUpdateKind
"/> instances.</summary>
95
public sealed class Converter : JsonConverter<
SpeechToTextResponseUpdateKind
>
98
public override
SpeechToTextResponseUpdateKind
Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
102
public override void Write(Utf8JsonWriter writer,
SpeechToTextResponseUpdateKind
value, JsonSerializerOptions options)
Microsoft.Extensions.AI.Abstractions.Tests (34)
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
314
if (type == typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
))
Generated\361d1da7f942c932\TestJsonSerializerContext.SpeechToTextResponseUpdate.g.cs (3)
51
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>
66
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.SpeechToTextResponseUpdate).GetProperty("Kind", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
), global::System.Array.Empty<global::System.Type>(), null),
69
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>(options, info0);
Generated\361d1da7f942c932\TestJsonSerializerContext.SpeechToTextResponseUpdateKind.g.cs (10)
13
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>? _SpeechToTextResponseUpdateKind;
19
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> SpeechToTextResponseUpdateKind
22
get => _SpeechToTextResponseUpdateKind ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
));
25
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> Create_SpeechToTextResponseUpdateKind(global::System.Text.Json.JsonSerializerOptions options)
27
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> jsonTypeInfo))
29
global::System.Text.Json.Serialization.JsonConverter converter = ExpandConverter(typeof(global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
), new global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
.Converter(), options);
30
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::Microsoft.Extensions.AI.
SpeechToTextResponseUpdateKind
> (options, converter);
SpeechToText\SpeechToTextResponseTests.cs (1)
231
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 (2)
18
Assert.Equal(
SpeechToTextResponseUpdateKind
.TextUpdating, update.Kind);
139
Assert.Equal(
SpeechToTextResponseUpdateKind
.TextUpdated, result.Kind);
TestJsonSerializerContext.cs (1)
21
[JsonSerializable(typeof(
SpeechToTextResponseUpdateKind
))]
Microsoft.Extensions.AI.OpenAI (3)
OpenAISpeechToTextClient.cs (3)
143
result.Kind =
SpeechToTextResponseUpdateKind
.TextUpdated;
148
result.Kind =
SpeechToTextResponseUpdateKind
.TextUpdated;
154
result.Kind =
SpeechToTextResponseUpdateKind
.SessionClose;
Microsoft.Extensions.AI.OpenAI.Tests (3)
OpenAISpeechToTextClientTests.cs (3)
326
Assert.Equal(
SpeechToTextResponseUpdateKind
.TextUpdated, updates[0].Kind);
331
Assert.Equal(
SpeechToTextResponseUpdateKind
.TextUpdated, updates[1].Kind);
341
Assert.Equal(
SpeechToTextResponseUpdateKind
.SessionClose, updates[2].Kind);