41 writes to Contents
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.Abstractions.Tests (26)
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (22)
35new() { Contents = [new UsageContent(new() { InputTokenCount = 1, OutputTokenCount = 2 })] },
36new() { Contents = [new UsageContent(new() { InputTokenCount = 4, OutputTokenCount = 5 })] },
187updates.Add(new() { Contents = [new DataContent("data:image/png;base64,aGVsbG8=")] });
217new() { Contents = [new TextReasoningContent("D")] },
218new() { Contents = [new TextReasoningContent("E")] },
219new() { Contents = [new TextReasoningContent("F")] },
222new() { Contents = [new TextReasoningContent("I")] },
223new() { Contents = [new TextReasoningContent("J")] },
225new() { Contents = [new TextReasoningContent("L")] },
228new() { Contents = [new TextReasoningContent("O")] },
229new() { Contents = [new TextReasoningContent("P")] },
255new() { Contents = [new TextContent("D") { Annotations = [new()] }] },
256new() { Contents = [new TextContent("E") { Annotations = [new()] }] },
257new() { Contents = [new TextContent("F") { Annotations = [new()] }] },
258new() { Contents = [new TextContent("G") { Annotations = [] }] },
259new() { Contents = [new TextContent("H") { Annotations = [] }] },
260new() { Contents = [new TextContent("I") { Annotations = [new()] }] },
261new() { Contents = [new TextContent("J") { Annotations = [new()] }] },
263new() { Contents = [new TextContent("L") { Annotations = [new()] }] },
266new() { Contents = [new TextContent("O") { Annotations = [new()] }] },
267new() { Contents = [new TextContent("P") { Annotations = [new()] }] },
294new() { Contents = [new UsageContent(new() { TotalTokenCount = 42 })] },
Microsoft.Extensions.AI.OpenAI.Tests (1)
Microsoft.Extensions.AI.Tests (12)
ChatCompletion\DistributedCachingChatClientTest.cs (8)
252Contents =
265Contents = [new FunctionCallContent("someCallId", "someFn", new Dictionary<string, object?> { ["arg1"] = "value1" })],
269Contents = [new UsageContent(new() { InputTokenCount = 123, OutputTokenCount = 456, TotalTokenCount = 99999 })],
315new() { Role = ChatRole.Assistant, Contents = [new FunctionCallContent("callId1", "separator")] },
368new() { Role = ChatRole.Assistant, Contents = [new TextContent("Hello")] },
369new() { Role = ChatRole.Assistant, Contents = [new TextContent(" world, ")] },
373Contents =
384Contents =
63 references to Contents
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (5)
Microsoft.Extensions.AI.Abstractions.Tests (23)
ChatCompletion\ChatResponseUpdateTests.cs (23)
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);
101TextContent textContent = Assert.IsType<TextContent>(update.Contents[3]);
106((TextContent)update.Contents[3]).Text = "text-3";
108Assert.Same(textContent, update.Contents[3]);
140Assert.Equal(5, result.Contents.Count);
142Assert.IsType<TextContent>(result.Contents[0]);
143Assert.Equal("text-1", ((TextContent)result.Contents[0]).Text);
145Assert.IsType<DataContent>(result.Contents[1]);
146Assert.Equal("data:image/png;base64,aGVsbG8=", ((DataContent)result.Contents[1]).Uri);
148Assert.IsType<FunctionCallContent>(result.Contents[2]);
149Assert.Equal("fc1", ((FunctionCallContent)result.Contents[2]).Name);
151Assert.IsType<DataContent>(result.Contents[3]);
152Assert.Equal("data"u8.ToArray(), ((DataContent)result.Contents[3]).Data.ToArray());
154Assert.IsType<TextContent>(result.Contents[4]);
155Assert.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.OpenAI (13)
Microsoft.Extensions.AI.OpenAI.Tests (6)
Microsoft.Extensions.AI.Tests (8)