7 writes to AdditionalCounts
Microsoft.Extensions.AI.Abstractions (1)
UsageDetails.cs (1)
43AdditionalCounts = new(countsToAdd);
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (1)
214AdditionalCounts = additionalCounts,
OllamaEmbeddingGenerator.cs (1)
140AdditionalCounts = additionalCounts,
Microsoft.Extensions.AI.OpenAI (1)
OpenAIModelMapper.ChatCompletion.cs (1)
425AdditionalCounts = new(),
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAISerializationTests.cs (2)
463AdditionalCounts = new() 582AdditionalCounts = new()
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
647AdditionalCounts = new() { ["firstValue"] = value, ["secondValue"] = value },
20 references to AdditionalCounts
Microsoft.Extensions.AI.Abstractions (5)
UsageDetails.cs (5)
39if (usage.AdditionalCounts is { } countsToAdd) 41if (AdditionalCounts is null) 49AdditionalCounts[kvp.Key] = AdditionalCounts.TryGetValue(kvp.Key, out var existingValue) ? 80if (AdditionalCounts is { } additionalCounts)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\UsageContentTests.cs (1)
29Assert.Null(c.Details.AdditionalCounts);
Microsoft.Extensions.AI.OpenAI (5)
OpenAIModelMapper.ChatCompletion.cs (5)
430destination.AdditionalCounts.Add( 434destination.AdditionalCounts.Add( 441destination.AdditionalCounts.Add( 445destination.AdditionalCounts.Add( 458if (usageDetails.AdditionalCounts is { Count: > 0 } additionalCounts)
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAIChatClientTests.cs (6)
208}, response.Usage.AdditionalCounts); 291}, usage.Details.AdditionalCounts); 555}, response.Usage.AdditionalCounts); 654}, response.Usage.AdditionalCounts); 886}, usage.Details.AdditionalCounts); 1025}, response.Usage.AdditionalCounts);
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\FunctionInvokingChatClientTests.cs (3)
630Assert.Equal(2, actualUsage.AdditionalCounts!.Count); 631Assert.Equal(expectedTotalTokenCounts, actualUsage.AdditionalCounts["firstValue"]); 632Assert.Equal(expectedTotalTokenCounts, actualUsage.AdditionalCounts["secondValue"]);