5 writes to Contents
Microsoft.Extensions.AI.Abstractions.Tests (3)
SpeechToText\SpeechToTextResponseTests.cs (3)
134response.Contents = newContents; 148Contents = 208Contents =
Microsoft.Extensions.AI.OpenAI (2)
OpenAISpeechToTextClient.cs (2)
85response.Contents = [new TextContent(translation.Text)]; 99response.Contents = [new TextContent(transcription.Text)];
27 references to Contents
Microsoft.Extensions.AI.Abstractions (5)
SpeechToText\SpeechToTextResponse.cs (2)
67/// This property concatenates the text of all <see cref="TextContent"/> objects in <see cref="Contents"/>. 79IList<AIContent> contents = Contents;
SpeechToText\SpeechToTextResponseUpdateExtensions.cs (3)
35ChatResponseExtensions.CoalesceTextContent((List<AIContent>)response.Contents); 61ChatResponseExtensions.CoalesceTextContent((List<AIContent>)response.Contents); 106response.Contents.Add(content);
Microsoft.Extensions.AI.Abstractions.Tests (22)
SpeechToText\SpeechToTextResponseTests.cs (19)
24Assert.Empty(response.Contents); 26Assert.NotNull(response.Contents); 27Assert.Same(response.Contents, response.Contents); 28Assert.Empty(response.Contents); 44Assert.Same(response.Contents, response.Contents); 47Assert.Empty(response.Contents); 51Assert.Single(response.Contents); 52TextContent tc = Assert.IsType<TextContent>(response.Contents[0]); 81Assert.Same(response.Contents, response.Contents); 84Assert.Empty(response.Contents); 89Assert.Equal(contentCount, response.Contents.Count); 92TextContent tc = Assert.IsType<TextContent>(response.Contents[i]); 135Assert.Same(newContents, response.Contents); 169Assert.Equal(4, result.Contents.Count); 171for (int i = 0; i < original.Contents.Count; i++) 173Assert.Equal($"Text{i + 1}", ((TextContent)result.Contents[i]).Text);
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (3)
124Assert.Equal(expected.Count + (gapLength * ((numSequences - 1) + (gapBeginningEnd ? 2 : 0))), response.Contents.Count); 126TextContent[] contents = response.Contents.OfType<TextContent>().ToArray(); 153Assert.Equal("Hello, world!", Assert.IsType<TextContent>(Assert.Single(response.Contents)).Text);