BerriAI/litellm · error · CohereError

raw_response.text

Error message

raw_response.text

What it means

Error "raw_response.text" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/cohere/rerank/transformation.py:147

        self,
        model: str,
        raw_response: httpx.Response,
        model_response: RerankResponse,
        logging_obj: LiteLLMLoggingObj,
        api_key: str | None = None,
        request_data: dict = {},
        optional_params: dict = {},
        litellm_params: dict = {},
    ) -> RerankResponse:
        """
        Transform Cohere rerank response

        No transformation required, litellm follows cohere API response format
        """
        try:
            raw_response_json: Final = raw_response.json()
        except Exception:
            raise CohereError(message=raw_response.text, status_code=raw_response.status_code)

        return RerankResponse(**raw_response_json)

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

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the Cohere error response body for details.

When it happens

Trigger: Thrown at litellm/llms/cohere/rerank/transformation.py:147 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/7512fc969c8089f5. Report an issue: GitHub.