{"record":{"id":"c43653b07404c1ec","repo":"BerriAI/litellm","slug":"failed-to-transform-streaming-response-c43653","errorCode":null,"errorMessage":"Failed to transform streaming response","messagePattern":"Failed to transform streaming response","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/adapters/handler.py","lineNumber":618,"sourceCode":"            top_k=top_k,\n            top_p=top_p,\n            output_format=output_format,\n            extra_kwargs=kwargs,\n        )\n\n        completion_response: Final = await litellm.acompletion(**completion_kwargs)\n\n        if stream:\n            transformed_stream: Final = ANTHROPIC_ADAPTER.translate_completion_output_params_streaming(\n                completion_response,\n                model=model,\n                tool_name_mapping=tool_name_mapping,\n                polyfill_result=polyfill_result,\n                is_async=True,\n            )\n            if transformed_stream is not None:\n                return transformed_stream\n            raise ValueError(\"Failed to transform streaming response\")\n        else:\n            anthropic_response: Final = ANTHROPIC_ADAPTER.translate_completion_output_params(\n                cast(ModelResponse, completion_response),\n                tool_name_mapping=tool_name_mapping,\n                polyfill_result=polyfill_result,\n            )\n            if anthropic_response is not None:\n                return anthropic_response\n            raise ValueError(\"Failed to transform response to Anthropic format\")\n\n    @staticmethod\n    def anthropic_messages_handler(\n        max_tokens: int,\n        messages: _AnthropicMessages,\n        model: str,\n        metadata: dict[str, object] | None = None,\n        stop_sequences: list[str] | None = None,\n        stream: bool | None = False,","sourceCodeStart":600,"sourceCodeEnd":636,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py#L600-L636","documentation":"Error \"Failed to transform streaming response\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/adapters/handler.py:618 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the upstream stream format; see logs for the failing chunk."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}