async def arequest_stream(
        self, endpoint: str, payload: Dict[str, Any]
    ) -> AsyncGenerator[str, None]:
        """
        Perform an asynchronous streaming request to the DeepInfra API.

        Args:
            endpoint (str): The API endpoint to send the request to.
            payload (Dict[str, Any]): The request payload.

        Yields:
            str: The streaming response from the API.

        """

        async def perform_request():
            async with aiohttp.ClientSession() as session:
                async with session.post(
                    self.get_url(endpoint),
                    json={
                        **payload,
                        "stream": True,
                    },
                    headers=self._get_headers(),
                    timeout=self.timeout,
                ) as response:
                    response.raise_for_status()
                    async for line in response.content:
                        if resp := maybe_decode_sse_data(line):
                            yield resp

        response = await aretry_request(perform_request, max_retries=self.max_retries)
        async for resp in response:
            yield resp

        Perform an asynchronous streaming request to the DeepInfra API.

        Args:
            endpoint (str): The API endpoint to send the request to.
            payload (Dict[str, Any]): The request payload.

        Yields:
            str: The streaming response from the API.

        
llama-index-integrations/llms/llama-index-llms-deepinfra/llama_index/llms/deepinfra/client.py