BerriAI/litellm · error · BedrockError

Error processing= , Received error=

Error message

Error processing={raw_response.text}, Received error={e}

What it means

Response-processing failure in the invoke response transformer: extracting the output text from the parsed completion_response raised (unexpected provider payload shape or missing keys), and the handler wraps the raw response text with the exception.

Solutions

  1. Inspect raw_response.text for the provider's error details.
  2. Verify request parameters against the model's expected schema.
  3. Retry; if persistent, capture the response and file an issue.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/llms/bedrock/chat/invoke_transformations/base_invoke_transformation.py:362 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/a03ac9c3ded2b66d. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/bedrock/chat/invoke_transformations/base_invoke_transformation.py:362

                    logging_obj=logging_obj,
                    request_data=request_data,
                    messages=messages,
                    optional_params=optional_params,
                    litellm_params=litellm_params,
                    encoding=encoding,
                    api_key=api_key,
                    json_mode=json_mode,
                )
            elif provider == "ai21":
                outputText = completion_response.get("completions")[0].get("data").get("text")
            elif provider == "meta" or provider == "llama" or provider == "deepseek_r1":
                outputText = completion_response["generation"]
            elif provider == "mistral":
                outputText = litellm.AmazonMistralConfig.get_outputText(completion_response, model_response)
            else:  # amazon titan
                outputText = completion_response.get("results")[0].get("outputText")
        except Exception as e:
            raise BedrockError(
                message=f"Error processing={raw_response.text}, Received error={e}",
                status_code=422,
            )

        try:
            if (
                outputText is not None
                and len(outputText) > 0
                and hasattr(model_response.choices[0], "message")
                and getattr(model_response.choices[0].message, "tool_calls", None) is None
            ):
                model_response.choices[0].message.content = outputText
            elif (
                hasattr(model_response.choices[0], "message")
                and getattr(model_response.choices[0].message, "tool_calls", None) is not None
            ):
                pass
            else:

View on GitHub (pinned to 77b7c6c40c)