def stream_chat(
        self,
        query: str,
        chat_history: Optional[List[ChatMessage]] = None,
    ):
        """
        Perform a streaming chat interaction with the spoke agent.

        Args:
            query (str): The query to be processed.
            chat_history (Optional[List[ChatMessage]], optional): The chat history. Defaults to None.

        Returns:
            str: The final response from the spoke agent.

        """
        stream_response = self.spoke_agent.stream_chat(query, chat_history=chat_history)
        final_response = ""
        for response in stream_response.chat_stream:
            final_response += response.message.content
        return final_response

        Perform a streaming chat interaction with the spoke agent.

        Args:
            query (str): The query to be processed.
            chat_history (Optional[List[ChatMessage]], optional): The chat history. Defaults to None.

        Returns:
            str: The final response from the spoke agent.

        
llama-index-packs/llama-index-packs-secgpt/llama_index/packs/secgpt/spoke.py