Skip to content

Conversation

rodriciru
Copy link

Add missing usage variables in GeminiMetadata class

Motivation and Context

Gemini gives us CachedContentTokenCount and ThoughtsTokenCount to know how much of cost have the request.
The total input as Gemini eyes is not only PromptTokenCount, but a sum of these 3 variables.

Description

Added CachedContentTokenCount and ThoughtsTokenCount variables, filled by the response and add test.

As I am beginner in C#, I can build and pass the test, also I can make an .nupkg of the code changed, but I can't test on other projects, so PLEASE check that before submitting changes. Thank you so much

Contribution Checklist

@rodriciru rodriciru requested a review from a team as a code owner October 2, 2025 14:10
@moonbox3 moonbox3 added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Oct 2, 2025
@github-actions github-actions bot changed the title Add Gemini usage metadata CachedContentTokenCount and ThoughtsTokenC… .Net: Add Gemini usage metadata CachedContentTokenCount and ThoughtsTokenC… Oct 2, 2025
@rodriciru
Copy link
Author

rodriciru commented Oct 2, 2025 via email

@markwallace-microsoft
Copy link
Member

@rodriciru please run dotnet format and commit the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants