{"record":{"id":"464f795389029ad5","repo":"BerriAI/litellm","slug":"streaming-request-failed-error-text-decode","errorCode":null,"errorMessage":"Streaming request failed: {error_text.decode()}","messagePattern":"Streaming request failed: (.+?)","errorType":"http","errorClass":"AzureAIAgentsError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/agents/handler.py","lineNumber":623,"sourceCode":"        url: Final = self._build_create_thread_and_run_url(api_base, api_version)\n        verbose_logger.debug(\"Azure AI Agents streaming - URL: %s\", url)\n\n        # Use LiteLLM's async HTTP client for streaming\n        client: Final = get_async_httpx_client(\n            llm_provider=litellm.LlmProviders.AZURE_AI,\n            params={\"ssl_verify\": litellm_params.get(\"ssl_verify\", None)},\n        )\n\n        response: Final = await client.post(\n            url=url,\n            headers=headers,\n            data=json.dumps(payload),\n            stream=True,\n        )\n\n        if response.status_code not in [200, 201]:\n            error_text: Final = await response.aread()\n            raise AzureAIAgentsError(\n                status_code=response.status_code,\n                message=f\"Streaming request failed: {error_text.decode()}\",\n            )\n\n        async for chunk in self._process_sse_stream(response, model):\n            yield chunk\n\n    async def _process_sse_stream(\n        self,\n        response: httpx.Response,\n        model: str,\n    ) -> AsyncIterator[ModelResponseStream]:\n        \"\"\"Process SSE stream and yield OpenAI-compatible streaming chunks.\"\"\"\n        from litellm.types.utils import Delta, ModelResponseStream, StreamingChoices\n\n        response_id: Final = f\"chatcmpl-{uuid.uuid4().hex[:8]}\"\n        created: Final = int(time.time())\n        thread_id = None","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/agents/handler.py#L605-L641","documentation":"Error \"Streaming request failed: {error_text.decode()}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/agents/handler.py:623 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the decoded error text in the message; fix the streaming request accordingly (auth, model, or payload)."],"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-23T08:17:48.524Z"}