google-genai: include thinking tokens in output token count#4206
google-genai: include thinking tokens in output token count#4206Rima-ag wants to merge 10 commits intoopen-telemetry:mainfrom
Conversation
431c67d to
2331945
Compare
|
i just saw open-telemetry/semantic-conventions#3383 that adds |
|
I think @DylanRussell can help decide here. It would be nice to get the general convention in as well. At least we should define a |
|
Isn't open-telemetry/semantic-conventions#3383 a general convention for an attribute on both logs on spans ? Yes I think we should wait for that to be merged if this isn't urgent, there are still a couple unresolved things on that PR |
|
Ah forgot this was open and opened the exact same PR: #4493 |
|
@DylanRussell I just resolved the conflicts, would you mind having a look? I have a followup draft PR #4276 to report thinking tokens in a separate field too and will request review as soon as this one is merged |
|
Rima I think we should go ahead and merge my PR which is all ready: #4493 |
Description
Updates the Google GenAI instrumentation to include thinking tokens in the total output token count.
Previously only candidate tokens were counted in the
output_tokens, resulting in inaccurate cost estimations for models that produce separate thinking tokens.Thinking tokens are reported in GenerateContentResponseUsageMetadata.thoughts_token_count.
#3890
Related to open-telemetry/semantic-conventions#3194
Type of change
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.