12 writes to OutputTokenCount
Microsoft.Extensions.AI.Abstractions (1)
UsageDetails.cs (1)
36OutputTokenCount = NullableSum(OutputTokenCount, usage.OutputTokenCount);
Microsoft.Extensions.AI.Abstractions.Tests (2)
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (2)
50new() { ChoiceIndex = 0, Contents = new[] { new UsageContent(new() { InputTokenCount = 1, OutputTokenCount = 2 }) } }, 51new() { ChoiceIndex = 3, Contents = new[] { new UsageContent(new() { InputTokenCount = 4, OutputTokenCount = 5 }) } },
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
129OutputTokenCount = completionsUsage.CompletionTokens, 221OutputTokenCount = usage.CompletionTokens,
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
212OutputTokenCount = response.EvalCount,
Microsoft.Extensions.AI.OpenAI (1)
OpenAIModelMapper.ChatCompletion.cs (1)
423OutputTokenCount = tokenUsage.OutputTokenCount,
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAISerializationTests.cs (2)
461OutputTokenCount = 9, 580OutputTokenCount = 9,
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
645OutputTokenCount = value,
ChatCompletion\OpenTelemetryChatClientTests.cs (2)
49OutputTokenCount = 20, 88OutputTokenCount = 20,
23 references to OutputTokenCount
Microsoft.Extensions.AI (2)
ChatCompletion\OpenTelemetryChatClient.cs (2)
344if (usage.OutputTokenCount is int outputTokens) 388if (completion.Usage?.OutputTokenCount is int outputTokens)
Microsoft.Extensions.AI.Abstractions (4)
UsageDetails.cs (4)
36OutputTokenCount = NullableSum(OutputTokenCount, usage.OutputTokenCount); 70if (OutputTokenCount is int output) 72parts.Add($"{nameof(OutputTokenCount)} = {output}");
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\UsageContentTests.cs (1)
27Assert.Null(c.Details.OutputTokenCount);
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
AzureAIInferenceChatClientTests.cs (2)
170Assert.Equal(9, response.Usage.OutputTokenCount); 668Assert.Equal(15, response.Usage.OutputTokenCount);
Microsoft.Extensions.AI.Integration.Tests (4)
ChatClientIntegrationTests.cs (4)
106Assert.True(response.Usage?.OutputTokenCount > 1); 107Assert.Equal(response.Usage?.InputTokenCount + response.Usage?.OutputTokenCount, response.Usage?.TotalTokenCount); 133Assert.True(usage.Details.OutputTokenCount > 1); 134Assert.Equal(usage.Details.InputTokenCount + usage.Details.OutputTokenCount, usage.Details.TotalTokenCount);
Microsoft.Extensions.AI.Ollama.Tests (2)
OllamaChatClientTests.cs (2)
128Assert.Equal(10, response.Usage.OutputTokenCount); 200Assert.Equal(20, usage.Details.OutputTokenCount);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIModelMapper.ChatCompletion.cs (1)
493outputTokenCount: usageDetails.OutputTokenCount ?? 0,
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAIChatClientTests.cs (6)
200Assert.Equal(9, response.Usage.OutputTokenCount); 282Assert.Equal(9, usage.Details.OutputTokenCount); 547Assert.Equal(15, response.Usage.OutputTokenCount); 646Assert.Equal(15, response.Usage.OutputTokenCount); 877Assert.Equal(16, usage.Details.OutputTokenCount); 1017Assert.Equal(15, response.Usage.OutputTokenCount);
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
628Assert.Equal(expectedTotalTokenCounts, actualUsage.OutputTokenCount);