BerriAI/litellm · error · OCIError

str(response_json["error"])

Error message

str(response_json["error"])

What it means

Error "str(response_json["error"])" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/oci/chat/transformation.py:617

        logging_obj: LiteLLMLoggingObj,
        request_data: dict,
        messages: list[AllMessageValues],
        optional_params: dict,
        litellm_params: dict,
        encoding: Any,
        api_key: str | None = None,
        json_mode: bool | None = None,
    ) -> ModelResponse:
        response_json: Final = raw_response.json()

        if not isinstance(response_json, dict):
            raise OCIError(
                message="Invalid response format from OCI",
                status_code=raw_response.status_code,
            )

        if response_json.get("error") is not None:
            raise OCIError(
                message=str(response_json["error"]),
                status_code=raw_response.status_code,
            )

        vendor: Final = get_vendor_from_model(model)
        if vendor == OCIVendors.COHERE:
            model_response = handle_cohere_response(response_json, model, model_response, raw_response)
        else:
            model_response = handle_generic_response(response_json, model, model_response, raw_response)

        model_response._hidden_params["additional_headers"] = raw_response.headers
        return model_response

    @track_llm_api_timing()
    def get_sync_custom_stream_wrapper(
        self,
        model: str,
        custom_llm_provider: str,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Read the OCI error field in the message; fix the indicated request problem (auth, model, payload).

When it happens

Trigger: Thrown at litellm/llms/oci/chat/transformation.py:617 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/afdd6bdc593f0cb2. Report an issue: GitHub.