async def achat(
        self, messages: Sequence[ChatMessage], **kwargs: Any
    ) -> ChatResponse:
        """
        Asynchronously generate a chat completion based on the input messages.

        Args:
            messages (Sequence[ChatMessage]): A sequence of chat messages.
            **kwargs: Additional keyword arguments.

        Returns:
            ChatResponse: The chat response from the LLM.

        """
        logger.debug(f"Calling achat with messages: {messages}")
        response = await self.async_client.chat(
            messages=_to_message_dicts(
                messages=messages, drop_none=kwargs.pop("drop_none", False)
            ),
            payload=self._model_kwargs(**kwargs),
            headers=self._prepare_headers(kwargs.pop("headers", {})),
            stream=False,
        )

        logger.debug(f"Received async chat response: {response}")
        try:
            choice = response["choices"][0]
            message = _from_message_dict(choice.get("message", ""))
            logprobs = _from_token_logprob_dicts(
                (choice.get("logprobs") or {}).get("content", {})
            )
            return ChatResponse(
                message=message,
                raw=response,
                logprobs=logprobs,
                additional_kwargs=_get_response_token_counts(response),
            )
        except (IndexError, KeyError, TypeError) as e:
            raise ValueError(f"Failed to parse response: {e!s}") from e

        Asynchronously generate a chat completion based on the input messages.

        Args:
            messages (Sequence[ChatMessage]): A sequence of chat messages.
            **kwargs: Additional keyword arguments.

        Returns:
            ChatResponse: The chat response from the LLM.

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