BerriAI/litellm · error · BedrockError

Error processing response: {e}

Error message

Error processing response: {e}

What it means

Error "Error processing response: {e}" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/bedrock/chat/agentcore/transformation.py:1028

            if usage_data:
                usage: Final = Usage(
                    prompt_tokens=usage_data.get("inputTokens", 0),
                    completion_tokens=usage_data.get("outputTokens", 0),
                    total_tokens=usage_data.get("totalTokens", 0),
                )
                setattr(model_response, "usage", usage)
            else:
                # Calculate token usage using LiteLLM's token counter
                verbose_logger.debug("No usage data from AgentCore - calculating tokens")
                calculated_usage: Final = self._calculate_usage(model, messages, content)
                if calculated_usage:
                    setattr(model_response, "usage", calculated_usage)

            return model_response

        except Exception as e:
            verbose_logger.error("Error processing Bedrock AgentCore response: %s", e)
            raise BedrockError(
                message=f"Error processing response: {e}",
                status_code=raw_response.status_code,
            )

    def validate_environment(
        self,
        headers: dict,
        model: str,
        messages: list[AllMessageValues],
        optional_params: dict,
        litellm_params: dict,
        api_key: str | None = None,
        api_base: str | None = None,
    ) -> dict:
        return headers

    def get_error_class(self, error_message: str, status_code: int, headers: dict | httpx.Headers) -> BaseLLMException:
        return BedrockError(status_code=status_code, message=error_message)

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Check the AgentCore response payload; see the wrapped exception.

When it happens

Trigger: Thrown at litellm/llms/bedrock/chat/agentcore/transformation.py:1028 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/783c03570924dc03. Report an issue: GitHub.