10 writes to Contents
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.Abstractions.Tests (7)
Microsoft.Extensions.AI.Tests (1)
69 references to Contents
Microsoft.Extensions.AI (3)
Microsoft.Extensions.AI.Abstractions (8)
Microsoft.Extensions.AI.Abstractions.Tests (39)
ChatCompletion\StreamingChatCompletionUpdateTests.cs (31)
20Assert.Empty(update.Contents);
43Assert.Empty(update.Contents);
44update.Contents.Add(new TextContent("text"));
45Assert.Single(update.Contents);
47Assert.Same(update.Contents, update.Contents);
50Assert.Same(newList, update.Contents);
52Assert.NotNull(update.Contents);
53Assert.Empty(update.Contents);
103TextContent textContent = Assert.IsType<TextContent>(update.Contents[3]);
111Assert.Same(textContent, update.Contents[3]);
122Assert.Empty(update.Contents);
127Assert.Single(update.Contents);
128TextContent textContent = Assert.IsType<TextContent>(update.Contents[0]);
144Assert.Equal(3, update.Contents.Count);
148Assert.Equal(4, update.Contents.Count);
152Assert.Equal(4, update.Contents.Count);
154update.Contents.RemoveAt(3);
155Assert.Equal(3, update.Contents.Count);
159Assert.Equal(4, update.Contents.Count);
190Assert.Equal(5, result.Contents.Count);
192Assert.IsType<TextContent>(result.Contents[0]);
193Assert.Equal("text-1", ((TextContent)result.Contents[0]).Text);
195Assert.IsType<ImageContent>(result.Contents[1]);
196Assert.Equal("http://localhost/image", ((ImageContent)result.Contents[1]).Uri);
198Assert.IsType<FunctionCallContent>(result.Contents[2]);
199Assert.Equal("fc1", ((FunctionCallContent)result.Contents[2]).Name);
201Assert.IsType<DataContent>(result.Contents[3]);
202Assert.Equal("data"u8.ToArray(), ((DataContent)result.Contents[3]).Data?.ToArray());
204Assert.IsType<TextContent>(result.Contents[4]);
205Assert.Equal("text-2", ((TextContent)result.Contents[4]).Text);
Microsoft.Extensions.AI.AzureAIInference (3)
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
Microsoft.Extensions.AI.Integration.Tests (1)
Microsoft.Extensions.AI.Ollama (2)
Microsoft.Extensions.AI.Ollama.Tests (4)
Microsoft.Extensions.AI.OpenAI (3)
Microsoft.Extensions.AI.OpenAI.Tests (4)