def prepare_for_new_chat(self):
        """
        Clears the history of prior calls to [`~Agent.chat`].
        """
        self.chat_history = None
        self.chat_state = {}
        self.cached_tools = None

        Clears the history of prior calls to [`~Agent.chat`].
        
dpkd/transformers/src/transformers/tools/agents.py