17 instantiations of TextToSpeechResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (6)
TextToSpeech\TextToSpeechResponseUpdateKind.cs (6)
22public static TextToSpeechResponseUpdateKind SessionOpen { get; } = new("sessionopen"); 25public static TextToSpeechResponseUpdateKind Error { get; } = new("error"); 28public static TextToSpeechResponseUpdateKind AudioUpdating { get; } = new("audioupdating"); 31public static TextToSpeechResponseUpdateKind AudioUpdated { get; } = new("audioupdated"); 34public static TextToSpeechResponseUpdateKind SessionClose { get; } = new("sessionclose"); 99new(reader.GetString()!);
Microsoft.Extensions.AI.Abstractions.Tests (11)
TextToSpeech\TextToSpeechResponseUpdateKindTests.cs (9)
15Assert.Equal("abc", new TextToSpeechResponseUpdateKind("abc").Value); 21Assert.Throws<ArgumentNullException>("value", () => new TextToSpeechResponseUpdateKind(null!)); 22Assert.Throws<ArgumentException>("value", () => new TextToSpeechResponseUpdateKind(" ")); 28var kind1 = new TextToSpeechResponseUpdateKind("abc"); 29var kind2 = new TextToSpeechResponseUpdateKind("ABC"); 35var kind3 = new TextToSpeechResponseUpdateKind("def"); 41Assert.Equal(kind1.GetHashCode(), new TextToSpeechResponseUpdateKind("abc").GetHashCode()); 42Assert.Equal(kind1.GetHashCode(), new TextToSpeechResponseUpdateKind("ABC").GetHashCode()); 58var kind = new TextToSpeechResponseUpdateKind("abc");
TextToSpeech\TextToSpeechResponseUpdateTests.cs (2)
27Kind = new TextToSpeechResponseUpdateKind("custom"), 49Kind = new TextToSpeechResponseUpdateKind("audiogenerated"),
56 references to TextToSpeechResponseUpdateKind
Microsoft.Extensions.AI.Abstractions (28)
TextToSpeech\TextToSpeechResponse.cs (1)
62Kind = TextToSpeechResponseUpdateKind.AudioUpdated,
TextToSpeech\TextToSpeechResponseUpdate.cs (2)
48public TextToSpeechResponseUpdateKind Kind { get; set; } = TextToSpeechResponseUpdateKind.AudioUpdating;
TextToSpeech\TextToSpeechResponseUpdateKind.cs (25)
19public readonly struct TextToSpeechResponseUpdateKind : IEquatable<TextToSpeechResponseUpdateKind> 22public static TextToSpeechResponseUpdateKind SessionOpen { get; } = new("sessionopen"); 25public static TextToSpeechResponseUpdateKind Error { get; } = new("error"); 28public static TextToSpeechResponseUpdateKind AudioUpdating { get; } = new("audioupdating"); 31public static TextToSpeechResponseUpdateKind AudioUpdated { get; } = new("audioupdated"); 34public 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> 61public 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> 73public static bool operator !=(TextToSpeechResponseUpdateKind left, TextToSpeechResponseUpdateKind right) 80=> obj is TextToSpeechResponseUpdateKind otherKind && Equals(otherKind); 83public bool Equals(TextToSpeechResponseUpdateKind other) 93/// <summary>Provides a <see cref="JsonConverter{T}"/> for serializing <see cref="TextToSpeechResponseUpdateKind"/> instances.</summary> 95public sealed class Converter : JsonConverter<TextToSpeechResponseUpdateKind> 98public override TextToSpeechResponseUpdateKind Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => 102public 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)
160Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdated, update.Kind);
TextToSpeech\TextToSpeechResponseUpdateKindTests.cs (16)
28var kind1 = new TextToSpeechResponseUpdateKind("abc"); 29var kind2 = new TextToSpeechResponseUpdateKind("ABC"); 35var kind3 = new TextToSpeechResponseUpdateKind("def"); 48Assert.Equal(TextToSpeechResponseUpdateKind.SessionOpen.ToString(), TextToSpeechResponseUpdateKind.SessionOpen.Value); 49Assert.Equal(TextToSpeechResponseUpdateKind.Error.ToString(), TextToSpeechResponseUpdateKind.Error.Value); 50Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdating.ToString(), TextToSpeechResponseUpdateKind.AudioUpdating.Value); 51Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdated.ToString(), TextToSpeechResponseUpdateKind.AudioUpdated.Value); 52Assert.Equal(TextToSpeechResponseUpdateKind.SessionClose.ToString(), TextToSpeechResponseUpdateKind.SessionClose.Value); 58var kind = new TextToSpeechResponseUpdateKind("abc"); 62var result = JsonSerializer.Deserialize<TextToSpeechResponseUpdateKind>(json, TestJsonSerializerContext.Default.TextToSpeechResponseUpdateKind);
TextToSpeech\TextToSpeechResponseUpdateTests.cs (2)
17Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdating, update.Kind); 89Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdated, result.Kind);
Microsoft.Extensions.AI.OpenAI (2)
OpenAITextToSpeechClient.cs (2)
120Kind = TextToSpeechResponseUpdateKind.AudioUpdating, 130Kind = TextToSpeechResponseUpdateKind.SessionClose,
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAITextToSpeechClientIntegrationTests.cs (2)
38if (update.Kind == TextToSpeechResponseUpdateKind.AudioUpdating) 45else if (update.Kind == TextToSpeechResponseUpdateKind.SessionClose)
OpenAITextToSpeechClientTests.cs (4)
271Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdated, update.Kind); 319Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdating, updates[0].Kind); 327Assert.Equal(TextToSpeechResponseUpdateKind.AudioUpdating, updates[1].Kind); 334Assert.Equal(TextToSpeechResponseUpdateKind.SessionClose, updates[2].Kind);