24 instantiations of TextToSpeechResponseUpdate
Microsoft.Extensions.AI.Abstractions (1)
TextToSpeech\TextToSpeechResponse.cs (1)
57TextToSpeechResponseUpdate update = new()
Microsoft.Extensions.AI.Abstractions.Tests (16)
TextToSpeech\DelegatingTextToSpeechClientTests.cs (2)
61new([new DataContent(new byte[] { 1, 2 }, "audio/mpeg")]), 62new([new DataContent(new byte[] { 3, 4 }, "audio/mpeg")])
TextToSpeech\TextToSpeechClientTests.cs (3)
68yield return new([new DataContent(new byte[] { 1 }, "audio/mpeg")]); 69yield return new([new DataContent(new byte[] { 2 }, "audio/mpeg")]); 70yield return new([new DataContent(new byte[] { 3 }, "audio/mpeg")]);
TextToSpeech\TextToSpeechResponseUpdateExtensionsTests.cs (8)
26new([new DataContent(new byte[] { 1 }, "audio/mpeg")]) { ModelId = "model123", AdditionalProperties = new() { ["a"] = "b" } }, 27new([new DataContent(new byte[] { 2 }, "audio/mpeg")]) { ModelId = "model123" }, 28new([new DataContent(new byte[] { 3 }, "audio/mpeg")]) { ModelId = "model123", AdditionalProperties = new() { ["c"] = "d" } }, 29new() { ResponseId = "someResponse", ModelId = "model123" }, 57new() { Contents = [new DataContent(new byte[] { 1 }, "audio/mpeg")] }, 58new() { Contents = [new UsageContent(new() { TotalTokenCount = 42 })] }, 59new() { Contents = [new DataContent(new byte[] { 2 }, "audio/mpeg")] }, 60new() { Contents = [new UsageContent(new() { InputTokenCount = 12, TotalTokenCount = 24 })] },
TextToSpeech\TextToSpeechResponseUpdateTests.cs (3)
15TextToSpeechResponseUpdate update = new(); 25TextToSpeechResponseUpdate update = new() 47TextToSpeechResponseUpdate original = new()
Microsoft.Extensions.AI.OpenAI (2)
OpenAITextToSpeechClient.cs (2)
118yield return new TextToSpeechResponseUpdate 128var sessionClose = new TextToSpeechResponseUpdate
Microsoft.Extensions.AI.Tests (5)
TextToSpeech\ConfigureOptionsTextToSpeechClientTests.cs (1)
38var expectedUpdates = Enumerable.Range(0, 3).Select(i => new TextToSpeechResponseUpdate()).ToArray();
TextToSpeech\LoggingTextToSpeechClientTests.cs (2)
110yield return new([new DataContent(new byte[] { 1 }, "audio/mpeg")]); 111yield return new([new DataContent(new byte[] { 2 }, "audio/mpeg")]);
TextToSpeech\OpenTelemetryTextToSpeechClientTests.cs (2)
66yield return new([new DataContent(new byte[] { 1 }, "audio/mpeg")]); 67yield return new()
73 references to TextToSpeechResponseUpdate
Microsoft.Extensions.AI (9)
TextToSpeech\ConfigureOptionsTextToSpeechClient.cs (2)
47public override async IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync( 50await foreach (var update in base.GetStreamingAudioAsync(text, Configure(options), cancellationToken))
TextToSpeech\LoggingTextToSpeechClient.cs (3)
97public override async IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync( 112IAsyncEnumerator<TextToSpeechResponseUpdate> e; 130TextToSpeechResponseUpdate? update = null;
TextToSpeech\OpenTelemetryTextToSpeechClient.cs (4)
132public override async IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync( 141IAsyncEnumerable<TextToSpeechResponseUpdate> updates; 153List<TextToSpeechResponseUpdate> trackedUpdates = []; 159TextToSpeechResponseUpdate update;
Microsoft.Extensions.AI.Abstractions (25)
TextToSpeech\DelegatingTextToSpeechClient.cs (1)
51public virtual IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync(
TextToSpeech\ITextToSpeechClient.cs (1)
47IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync(
TextToSpeech\TextToSpeechResponse.cs (4)
47/// <summary>Creates an array of <see cref="TextToSpeechResponseUpdate" /> instances that represent this <see cref="TextToSpeechResponse" />.</summary> 48/// <returns>An array of <see cref="TextToSpeechResponseUpdate" /> instances that may be used to represent this <see cref="TextToSpeechResponse" />.</returns> 49public TextToSpeechResponseUpdate[] ToTextToSpeechResponseUpdates() 57TextToSpeechResponseUpdate update = new()
TextToSpeech\TextToSpeechResponseUpdate.cs (7)
16/// <para><see cref="TextToSpeechResponseUpdate"/> is so named because it represents streaming updates 20/// but all of those with a non-<see langword="null"/> value must have the same value (e.g. <see cref="TextToSpeechResponseUpdate.ResponseId"/>). 23/// The relationship between <see cref="TextToSpeechResponse"/> and <see cref="TextToSpeechResponseUpdate"/> is 27/// all have different <see cref="TextToSpeechResponseUpdate.RawRepresentation"/> objects whereas there's 34/// <summary>Initializes a new instance of the <see cref="TextToSpeechResponseUpdate"/> class.</summary> 40/// <summary>Initializes a new instance of the <see cref="TextToSpeechResponseUpdate"/> class.</summary> 58/// If a <see cref="TextToSpeechResponseUpdate"/> is created to represent some underlying object from another object
TextToSpeech\TextToSpeechResponseUpdateExtensions.cs (10)
14/// Provides extension methods for working with <see cref="TextToSpeechResponseUpdate"/> instances. 19/// <summary>Combines <see cref="TextToSpeechResponseUpdate"/> instances into a single <see cref="TextToSpeechResponse"/>.</summary> 23this IEnumerable<TextToSpeechResponseUpdate> updates) 29foreach (var update in updates) 37/// <summary>Combines <see cref="TextToSpeechResponseUpdate"/> instances into a single <see cref="TextToSpeechResponse"/>.</summary> 42this IAsyncEnumerable<TextToSpeechResponseUpdate> updates, CancellationToken cancellationToken = default) 49IAsyncEnumerable<TextToSpeechResponseUpdate> updates, CancellationToken cancellationToken) 53await foreach (var update in updates.WithCancellation(cancellationToken).ConfigureAwait(false)) 62/// <summary>Processes the <see cref="TextToSpeechResponseUpdate"/>, incorporating its contents and properties.</summary> 66TextToSpeechResponseUpdate update,
Utilities\AIJsonUtilities.Defaults.cs (2)
135[JsonSerializable(typeof(TextToSpeechResponseUpdate))] 136[JsonSerializable(typeof(IReadOnlyList<TextToSpeechResponseUpdate>))]
Microsoft.Extensions.AI.Abstractions.Tests (21)
TestJsonSerializerContext.cs (1)
24[JsonSerializable(typeof(TextToSpeechResponseUpdate))]
TestTextToSpeechClient.cs (2)
31IAsyncEnumerable<TextToSpeechResponseUpdate>>? 46public IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync(
TextToSpeech\DelegatingTextToSpeechClientTests.cs (1)
59TextToSpeechResponseUpdate[] expectedResults =
TextToSpeech\TextToSpeechClientTests.cs (3)
53List<TextToSpeechResponseUpdate> updates = []; 54await foreach (var update in client.GetStreamingAudioAsync("Hello!", expectedOptions, cts.Token)) 66private static async IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingUpdatesAsync()
TextToSpeech\TextToSpeechResponseTests.cs (2)
152TextToSpeechResponseUpdate[] updates = response.ToTextToSpeechResponseUpdates(); 157TextToSpeechResponseUpdate update = updates[0];
TextToSpeech\TextToSpeechResponseUpdateExtensionsTests.cs (6)
16Assert.Throws<ArgumentNullException>("updates", () => ((List<TextToSpeechResponseUpdate>)null!).ToTextToSpeechResponse()); 24TextToSpeechResponseUpdate[] updates = 55TextToSpeechResponseUpdate[] updates = 75private static async IAsyncEnumerable<TextToSpeechResponseUpdate> YieldAsync(IEnumerable<TextToSpeechResponseUpdate> updates) 77foreach (TextToSpeechResponseUpdate update in updates)
TextToSpeech\TextToSpeechResponseUpdateTests.cs (6)
15TextToSpeechResponseUpdate update = new(); 25TextToSpeechResponseUpdate update = new() 47TextToSpeechResponseUpdate original = new() 58TextToSpeechResponseUpdate? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.TextToSpeechResponseUpdate); 86TextToSpeechResponseUpdate? result = JsonSerializer.Deserialize<TextToSpeechResponseUpdate>(Json, AIJsonUtilities.DefaultOptions);
Microsoft.Extensions.AI.Integration.Tests (1)
TextToSpeechClientIntegrationTests.cs (1)
109await foreach (var update in _client.GetStreamingAudioAsync("Hello, world!"))
Microsoft.Extensions.AI.OpenAI (3)
OpenAITextToSpeechClient.cs (3)
80public async IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync( 105foreach (var update in (await GetAudioAsync(text, options, cancellationToken).ConfigureAwait(false)).ToTextToSpeechResponseUpdates()) 128var sessionClose = new TextToSpeechResponseUpdate
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAITextToSpeechClientIntegrationTests.cs (1)
33await foreach (var update in client.GetStreamingAudioAsync("The quick brown fox jumps over the lazy dog."))
OpenAITextToSpeechClientTests.cs (3)
266await foreach (var update in client.GetStreamingAudioAsync("Hello streaming")) 310List<TextToSpeechResponseUpdate> updates = []; 311await foreach (var update in client.GetStreamingAudioAsync("Hello streaming"))
Microsoft.Extensions.AI.Tests (10)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestTextToSpeechClient.cs (2)
31IAsyncEnumerable<TextToSpeechResponseUpdate>>? 46public IAsyncEnumerable<TextToSpeechResponseUpdate> GetStreamingAudioAsync(
TextToSpeech\ConfigureOptionsTextToSpeechClientTests.cs (3)
89static async IAsyncEnumerable<TextToSpeechResponseUpdate> YieldUpdates(TextToSpeechResponseUpdate[] updates) 91foreach (var update in updates)
TextToSpeech\LoggingTextToSpeechClientTests.cs (2)
107static async IAsyncEnumerable<TextToSpeechResponseUpdate> GetUpdatesAsync() 119await foreach (var update in client.GetStreamingAudioAsync(
TextToSpeech\OpenTelemetryTextToSpeechClientTests.cs (3)
62static async IAsyncEnumerable<TextToSpeechResponseUpdate> TestClientStreamAsync( 102await foreach (var update in client.GetStreamingAudioAsync("Hello, world!", options)) 168await foreach (var update in client.GetStreamingAudioAsync("Hello"))