{"record":{"id":"ed691af8acdb065c","repo":"BerriAI/litellm","slug":"boto3-botocore-is-required-for-aws-event-stream-pa","errorCode":null,"errorMessage":"boto3/botocore is required for AWS event stream parsing","messagePattern":"boto3/botocore is required for AWS event stream parsing","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/chat/invoke_agent/transformation.py","lineNumber":172,"sourceCode":"    ) -> dict:\n        # use the last message content as the query\n        query: Final[str] = convert_content_list_to_str(messages[-1])\n        return {\n            \"inputText\": query,\n            \"enableTrace\": True,\n            **optional_params,\n        }\n\n    def _parse_aws_event_stream(self, raw_content: bytes) -> InvokeAgentEventList:\n        \"\"\"\n        Parse AWS event stream format using boto3/botocore's built-in parser.\n        This is the same approach used in the existing AWSEventStreamDecoder.\n        \"\"\"\n        try:\n            from botocore.eventstream import EventStreamBuffer\n            from botocore.parsers import EventStreamJSONParser\n        except ImportError:\n            raise ImportError(\"boto3/botocore is required for AWS event stream parsing\")\n\n        events: Final[InvokeAgentEventList] = []\n        parser: Final = EventStreamJSONParser()\n        event_stream_buffer: Final = EventStreamBuffer()\n\n        # Add the entire response to the buffer\n        event_stream_buffer.add_data(raw_content)\n\n        # Process all events in the buffer\n        for event in event_stream_buffer:\n            try:\n                headers = self._extract_headers_from_event(event)\n\n                event_type = headers.get(\"event_type\", \"\")\n\n                if event_type == \"chunk\":\n                    # Handle chunk events specially - they contain decoded content, not JSON\n                    message = self._parse_message_from_event(event, parser)","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/chat/invoke_agent/transformation.py#L154-L190","documentation":"Error \"boto3/botocore is required for AWS event stream parsing\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/chat/invoke_agent/transformation.py:172 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install boto3/botocore for AWS event stream parsing."],"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-15T17:31:12.345Z"}