2 writes to Details
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\UsageContentTests.cs (2)
44c.Details = details2; 56Assert.Throws<ArgumentNullException>("value", () => c.Details = null!);
31 references to Details
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (1)
188completion.Usage = c.Details;
Microsoft.Extensions.AI.Abstractions.Tests (13)
ChatCompletion\ChatCompletionTests.cs (1)
295Assert.Equal(123, Assert.IsType<UsageContent>(Assert.Single(update2.Contents)).Details.TotalTokenCount);
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (1)
67Assert.Same(Assert.IsType<UsageContent>(updates[6].Contents[0]).Details, completion.Usage);
Contents\UsageContentTests.cs (11)
24Assert.NotNull(c.Details); 25Assert.Same(c.Details, c.Details); 26Assert.Null(c.Details.InputTokenCount); 27Assert.Null(c.Details.OutputTokenCount); 28Assert.Null(c.Details.TotalTokenCount); 29Assert.Null(c.Details.AdditionalCounts); 41Assert.Same(details, c.Details); 45Assert.Same(details2, c.Details); 53UsageDetails d = c.Details; 58Assert.Same(d, c.Details);
Microsoft.Extensions.AI.Integration.Tests (5)
ChatClientIntegrationTests.cs (5)
132Assert.True(usage.Details.InputTokenCount > 1); 133Assert.True(usage.Details.OutputTokenCount > 1); 134Assert.Equal(usage.Details.InputTokenCount + usage.Details.OutputTokenCount, usage.Details.TotalTokenCount);
Microsoft.Extensions.AI.Ollama.Tests (3)
OllamaChatClientTests.cs (3)
199Assert.Equal(11, usage.Details.InputTokenCount); 200Assert.Equal(20, usage.Details.OutputTokenCount); 201Assert.Equal(31, usage.Details.TotalTokenCount);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIModelMappers.StreamingChatCompletion.cs (1)
44chatTokenUsage = ToOpenAIUsage(usageContent.Details);
Microsoft.Extensions.AI.OpenAI.Tests (8)
OpenAIChatClientTests.cs (8)
281Assert.Equal(8, usage.Details.InputTokenCount); 282Assert.Equal(9, usage.Details.OutputTokenCount); 283Assert.Equal(17, usage.Details.TotalTokenCount); 291}, usage.Details.AdditionalCounts); 876Assert.Equal(61, usage.Details.InputTokenCount); 877Assert.Equal(16, usage.Details.OutputTokenCount); 878Assert.Equal(77, usage.Details.TotalTokenCount); 886}, usage.Details.AdditionalCounts);