def _get_response_token_counts(
        self, response: Optional[Dict[str, Any]] = None
    ) -> dict:
        """Get the token usage reported by the response."""
        if not response or not isinstance(response, dict):
            return {}

        usage = response.get("usage", {})
        if not usage:
            return {}

        # Convert Bedrock's token count format to match OpenAI's format
        return {
            "prompt_tokens": usage.get("inputTokens", 0),
            "completion_tokens": usage.get("outputTokens", 0),
            "total_tokens": usage.get("totalTokens", 0),
        }
Get the token usage reported by the response.
llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/base.py