11 references to UsageContent
Microsoft.Extensions.AI (1)
ChatCompletion\FunctionInvokingChatClient.cs (1)
259response.Message.Contents = [.. response.Message.Contents, new UsageContent(usage)];
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatCompletion.cs (1)
124extra.Contents.Add(new UsageContent(usage));
Microsoft.Extensions.AI.Abstractions.Tests (5)
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (3)
50new() { ChoiceIndex = 0, Contents = new[] { new UsageContent(new() { InputTokenCount = 1, OutputTokenCount = 2 }) } }, 51new() { ChoiceIndex = 3, Contents = new[] { new UsageContent(new() { InputTokenCount = 4, OutputTokenCount = 5 }) } }, 199new() { Contents = [new UsageContent(new() { TotalTokenCount = 42 })] },
Contents\UsageContentTests.cs (2)
14Assert.Throws<ArgumentNullException>("details", () => new UsageContent(null!)); 37UsageContent c = new(details);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
216completionUpdate.Contents.Add(new UsageContent(new()
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
168update.Contents.Add(new UsageContent(usage));
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
310completionUpdate.Contents.Add(new UsageContent(usageDetails));
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
80Contents = [new UsageContent(new()