11 writes to InputTokenCount
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 (3)
AzureAIInferenceChatClient.cs (2)
126InputTokenCount = completionsUsage.PromptTokens, 218InputTokenCount = usage.PromptTokens,
AzureAIInferenceEmbeddingGenerator.cs (1)
103InputTokenCount = embeddings.Usage.PromptTokens,
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (1)
200InputTokenCount = response.PromptEvalCount,
OllamaEmbeddingGenerator.cs (1)
138InputTokenCount = tokens,
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (1)
295InputTokenCount = tokenUsage.InputTokenCount,
OpenAIEmbeddingGenerator.cs (1)
127InputTokenCount = embeddings.Usage.InputTokenCount,
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\OpenTelemetryChatClientTests.cs (2)
48InputTokenCount = 10, 82InputTokenCount = 10,
20 references to InputTokenCount
Microsoft.Extensions.AI (3)
ChatCompletion\OpenTelemetryChatClient.cs (2)
322if (usage.InputTokenCount is int inputTokens) 369if (completion.Usage?.InputTokenCount is int inputTokens)
Embeddings\OpenTelemetryEmbeddingGenerator.cs (1)
170if (embeddings.Usage?.InputTokenCount is int i)
Microsoft.Extensions.AI.Abstractions (2)
UsageDetails.cs (2)
33if (InputTokenCount is int input) 35parts.Add($"{nameof(InputTokenCount)} = {input}");
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\UsageContentTests.cs (1)
26Assert.Null(c.Details.InputTokenCount);
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
AzureAIInferenceChatClientTests.cs (2)
156Assert.Equal(8, response.Usage.InputTokenCount); 418Assert.Equal(42, response.Usage.InputTokenCount);
Microsoft.Extensions.AI.Integration.Tests (4)
ChatClientIntegrationTests.cs (4)
106Assert.True(response.Usage?.InputTokenCount > 1); 108Assert.Equal(response.Usage?.InputTokenCount + response.Usage?.OutputTokenCount, response.Usage?.TotalTokenCount); 133Assert.True(usage.Details.InputTokenCount > 1); 135Assert.Equal(usage.Details.InputTokenCount + usage.Details.OutputTokenCount, usage.Details.TotalTokenCount);
Microsoft.Extensions.AI.Ollama.Tests (2)
OllamaChatClientTests.cs (2)
127Assert.Equal(11, response.Usage.InputTokenCount); 199Assert.Equal(11, usage.Details.InputTokenCount);
Microsoft.Extensions.AI.OpenAI.Tests (6)
OpenAIChatClientTests.cs (6)
199Assert.Equal(8, response.Usage.InputTokenCount); 275Assert.Equal(8, usage.Details.InputTokenCount); 472Assert.Equal(42, response.Usage.InputTokenCount); 565Assert.Equal(42, response.Usage.InputTokenCount); 782Assert.Equal(61, usage.Details.InputTokenCount); 916Assert.Equal(42, response.Usage.InputTokenCount);