def chat(
        self,
        query: str,
    ) -> str:
        """
        Process a user query and generate a response.

        Args:
            query (str): The user query to process.

        Returns:
            str: The response generated by SecGPT.

        """
        memory_content = self.memory.get()
        self.memory.put(ChatMessage(role=MessageRole.USER, content=(query)))
        tool_info = self.tool_importer.get_tool_info()
        plan = self.planner.plan_generate(query, tool_info, memory_content)
        response = self.hub_operator.run(query, plan)
        self.memory.put(ChatMessage(role=MessageRole.CHATBOT, content=(response)))

        return response

        Process a user query and generate a response.

        Args:
            query (str): The user query to process.

        Returns:
            str: The response generated by SecGPT.

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