Add thoughts_token_count, cached_content_token_count and tool_use_prompt_token_count to UsageMetadata
#9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
UsageMetadatainsrc/types/generate_content.rsonly deserializes three fields:Impact
Vertex AI's
usageMetadataalso reportsthoughtsTokenCount,cachedContentTokenCountandtoolUsePromptTokenCount(already supported ingeologia::prelude::UsageMetadata). Becausegemini-rsdrops them,devrel-pr-reviewer'susage_from_vertex(crates/shared/src/agents/vertex_model.rs) has to hardcodethinking_tokens,cached_input_tokensandtool_use_prompt_tokenstoNone, so thinking token counts are never recorded on PR review runs.Proposed fix
Add the missing optional fields (and derive
Clone,Default,PartialEq,Eq):