Repository navigation
fix: preserve Gemini total token usage - #44
superdav42 merged 2 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@saarnilauri as the original issue reporter, are you able to review this to see if it resolves things properly for you? |
@jeffpaul yes, for sure. |
|
Thanks @zahidgh, this fixes #22 and I verified it rather than just reading the diff. I checked out the branch and ran I also probed the live API directly (thinking off, thinking on, and a tool-use call) to sanity-check the two code paths: @jeffpaul One thing worth flagging: issue #22 asks for the fix on both the pre-1.3.0 and 1.3.0+ paths, and the 1.3.0+ path only exists in PR #21, which is still open. Fixing trunk's single path here is correct, but #21 currently computes the total as Approving. |
superdav42
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks for your contribution.
Summary
totalTokenCountwhen parsing Gemini usage metadataThe previous implementation computed the total from completion and thought tokens only, so prompt tokens were silently omitted from usage reporting.
Testing
composer testcomposer lintgit diff --checkFixes #22