BerriAI/litellm · error · NotImplementedError

Subclasses must implement this method

Error message

Subclasses must implement this method

What it means

Error "Subclasses must implement this method" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/base_llm/anthropic_messages/transformation.py:138

        Whether the upstream this config routes to executes ``web_search`` tools
        itself as part of its Anthropic Messages agentic loop.

        The web-search interception handler short-circuits web-search-only
        requests (running the search itself and returning synthetic results) only
        for providers that do NOT. Providers whose agentic loop already performs
        the search plus a follow-up synthesis step (bedrock, vertex_ai, ...)
        return True so those requests flow through untouched.
        """
        return True

    def get_async_streaming_response_iterator(
        self,
        model: str,
        httpx_response: httpx.Response,
        request_body: dict,
        litellm_logging_obj: LiteLLMLoggingObj,
    ) -> AsyncIterator:
        raise NotImplementedError("Subclasses must implement this method")

    def get_error_class(
        self, error_message: str, status_code: int, headers: dict | httpx.Headers
    ) -> "BaseLLMException":
        from litellm.llms.base_llm.chat.transformation import BaseLLMException

        return BaseLLMException(message=error_message, status_code=status_code, headers=headers)

    @property
    def max_retry_on_anthropic_messages_http_error(self) -> int:
        """
        Max HTTP attempts for /v1/messages when the handler may mutate the body and
        retry (e.g. strip invalid encrypted thinking signatures after a deployment or
        credential change).
        """
        return 2

    def should_retry_anthropic_messages_on_http_error(self, e: httpx.HTTPStatusError, litellm_params: dict) -> bool:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. This is a base-class method; use a concrete provider subclass that implements it instead of calling the base class.

When it happens

Trigger: Thrown at litellm/llms/base_llm/anthropic_messages/transformation.py:138 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/812a52a54b258c42. Report an issue: GitHub.