async def astream_complete(
        self, prompt: str, formatted: bool = False, **kwargs: Any
    ) -> CompletionResponseAsyncGen:
        """
        Asynchronously stream the completion for the given prompt.

        Args:
            prompt (str): The prompt to generate a completion for.
            formatted (bool): Whether the prompt is formatted.
            **kwargs: Additional keyword arguments.

        Yields:
            CompletionResponse: The streamed response from the LLM.

        """

        async def gen() -> CompletionResponseAsyncGen:
            logger.debug(f"Starting astream_complete with prompt: {prompt}")
            text = ""

            async for response in await self.async_client.generate(
                prompt=prompt,
                payload=self._model_kwargs(**kwargs),
                headers=self._prepare_headers(kwargs.pop("headers", {})),
                stream=True,
            ):
                logger.debug(f"Received async chunk: {response}")
                if len(response.get("choices", [])) > 0:
                    delta = response["choices"][0].get("text")
                    if delta is None:
                        delta = ""
                else:
                    delta = ""
                text += delta

                yield CompletionResponse(
                    delta=delta,
                    text=text,
                    raw=response,
                    additional_kwargs=_get_response_token_counts(response),
                )

        return gen()

        Asynchronously stream the completion for the given prompt.

        Args:
            prompt (str): The prompt to generate a completion for.
            formatted (bool): Whether the prompt is formatted.
            **kwargs: Additional keyword arguments.

        Yields:
            CompletionResponse: The streamed response from the LLM.

        
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/base.py