2 writes to Details
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\UsageContentTests.cs (2)
44c.Details = details2; 56Assert.Throws<ArgumentNullException>("value", () => c.Details = null!);
33 references to Details
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (1)
172completion.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.AdditionalProperties); 41Assert.Same(details, c.Details); 45Assert.Same(details2, c.Details); 53UsageDetails d = c.Details; 58Assert.Same(d, c.Details);
Microsoft.Extensions.AI.Integration.Tests (6)
ChatClientIntegrationTests.cs (6)
133Assert.True(usage.Details.InputTokenCount > 1); 134Assert.True(usage.Details.OutputTokenCount > 1); 135Assert.Equal(usage.Details.InputTokenCount + usage.Details.OutputTokenCount, usage.Details.TotalTokenCount); 185Assert.True(finalUsage.TotalTokenCount > intermediate.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.Tests (10)
OpenAIChatClientTests.cs (10)
275Assert.Equal(8, usage.Details.InputTokenCount); 276Assert.Equal(9, usage.Details.OutputTokenCount); 277Assert.Equal(17, usage.Details.TotalTokenCount); 278Assert.NotNull(usage.Details.AdditionalProperties); 279Assert.Equal(new Dictionary<string, object> { [nameof(ChatOutputTokenUsageDetails.ReasoningTokenCount)] = 0 }, usage.Details.AdditionalProperties[nameof(ChatTokenUsage.OutputTokenDetails)]); 782Assert.Equal(61, usage.Details.InputTokenCount); 783Assert.Equal(16, usage.Details.OutputTokenCount); 784Assert.Equal(77, usage.Details.TotalTokenCount); 785Assert.NotNull(usage.Details.AdditionalProperties); 786Assert.Equal(new Dictionary<string, object> { [nameof(ChatOutputTokenUsageDetails.ReasoningTokenCount)] = 0 }, usage.Details.AdditionalProperties[nameof(ChatTokenUsage.OutputTokenDetails)]);