async def astream_chat(
        self,
        messages: Sequence[ChatMessage],
        **kwargs: Any,
    ) -> ChatResponseAsyncGen:
        """
        Asynchronous request a chat, and the response is returned in a stream.

        :param messages: The chat message list. The last message is the current request,
            and the previous messages are the historical chat information. The number of
            members must be odd, and the role value of the odd-numbered messages must be
            "user", while the role value of the even-numbered messages must be "assistant".
        :return: A ChatResponseAsyncGen object, which is a asynchronous generator of ChatResponse.
        """
        request = build_chat_request(stream=True, messages=messages, **kwargs)

        async def gen():
            resp_dict_iter = self._client.apost_reply_stream(
                self.endpoint_url, json=request.dict()
            )
            async for part in aparse_stream_chat_response(resp_dict_iter):
                yield part

        return gen()

        Asynchronous request a chat, and the response is returned in a stream.

        :param messages: The chat message list. The last message is the current request,
            and the previous messages are the historical chat information. The number of
            members must be odd, and the role value of the odd-numbered messages must be
            "user", while the role value of the even-numbered messages must be "assistant".
        :return: A ChatResponseAsyncGen object, which is a asynchronous generator of ChatResponse.
        
llama-index-integrations/llms/llama-index-llms-qianfan/llama_index/llms/qianfan/base.py