{"record":{"id":"3abe17c562058900","repo":"BerriAI/litellm","slug":"expected-responsesapiresponse-got-type-result","errorCode":null,"errorMessage":"Expected ResponsesAPIResponse, got {type(result)}","messagePattern":"Expected ResponsesAPIResponse, got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/responses_adapters/handler.py","lineNumber":176,"sourceCode":"            system=system,\n            temperature=temperature,\n            thinking=thinking,\n            tool_choice=tool_choice,\n            tools=tools,\n            top_k=top_k,\n            top_p=top_p,\n            output_format=output_format,\n            extra_kwargs=kwargs,\n        )\n\n        result: Final = await litellm.aresponses(**responses_kwargs)\n\n        if stream:\n            wrapper: Final = AnthropicResponsesStreamWrapper(responses_stream=result, model=model)\n            return wrapper.async_anthropic_sse_wrapper()\n\n        if not isinstance(result, ResponsesAPIResponse):\n            raise ValueError(f\"Expected ResponsesAPIResponse, got {type(result)}\")\n\n        return _ADAPTER.translate_response(result)\n\n    @staticmethod\n    def anthropic_messages_handler(\n        max_tokens: int,\n        messages: list[dict],\n        model: str,\n        context_management: dict | None = None,\n        metadata: dict | None = None,\n        output_config: AnthropicOutputConfig | None = None,\n        stop_sequences: list[str] | None = None,\n        stream: bool | None = False,\n        system: str | None = None,\n        temperature: float | None = None,\n        thinking: dict | None = None,\n        tool_choice: dict | None = None,\n        tools: list[AllAnthropicToolsValues | dict] | None = None,","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/experimental_pass_through/responses_adapters/handler.py#L158-L194","documentation":"Error \"Expected ResponsesAPIResponse, got {type(result)}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/responses_adapters/handler.py:176 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the upstream adapter; it returned an unexpected type instead of ResponsesAPIResponse.","Upgrade litellm; the adapter contract may have changed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}