Skip to content

Conversation

@rodriciru
Copy link
Contributor

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
Contributor Author

rodriciru commented Oct 2, 2025 via email

@markwallace-microsoft
Copy link
Member

@rodriciru please run dotnet format and commit the changes

@rogerbarreto rogerbarreto added this pull request to the merge queue Nov 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 3, 2025
@rogerbarreto rogerbarreto added this pull request to the merge queue Nov 3, 2025
Merged via the queue into microsoft:main with commit c804629 Nov 3, 2025
18 checks passed
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.

4 participants