Describe the bug
The Bedrock chat client only surfaces input, output, and total token counts in usage_details. When prompt caching is active, the Bedrock Converse API also reports cacheReadInputTokens (input tokens served from a cache) and cacheWriteInputTokens (input tokens written to a cache), but _parse_usage drops both. So cache usage silently reads as zero for cached prompts, which throws off cost and token accounting.
UsageDetails already defines canonical fields for these (cache_read_input_token_count, cache_creation_input_token_count), and the OpenAI and Anthropic connectors already populate them — Bedrock is the odd one out.
Where
python/packages/bedrock/agent_framework_bedrock/_chat_client.py, BedrockChatClient._parse_usage.
Expected behavior
When the Converse response includes cacheReadInputTokens / cacheWriteInputTokens, map them to cache_read_input_token_count / cache_creation_input_token_count in usage_details, matching the OpenAI and Anthropic connectors.
Describe the bug
The Bedrock chat client only surfaces
input,output, andtotaltoken counts inusage_details. When prompt caching is active, the Bedrock Converse API also reportscacheReadInputTokens(input tokens served from a cache) andcacheWriteInputTokens(input tokens written to a cache), but_parse_usagedrops both. So cache usage silently reads as zero for cached prompts, which throws off cost and token accounting.UsageDetailsalready defines canonical fields for these (cache_read_input_token_count,cache_creation_input_token_count), and the OpenAI and Anthropic connectors already populate them — Bedrock is the odd one out.Where
python/packages/bedrock/agent_framework_bedrock/_chat_client.py,BedrockChatClient._parse_usage.Expected behavior
When the Converse response includes
cacheReadInputTokens/cacheWriteInputTokens, map them tocache_read_input_token_count/cache_creation_input_token_countinusage_details, matching the OpenAI and Anthropic connectors.