text: the action to take, should be one of [{tool_names}]Action Input: the input to the actionObservation: the result of the action... (this Thought/Action/Action Input/Observation can repeat N times)Thought: I now know the final answerFinal Answer: the final answer to the original input questionQuestion: {input}{agent_scratchpad}"""# Set up a prompt templateclass CustomPromptTemplate(StringPromptTemplate):    # The template to use    template: str    # The list of tools available    tools: List[Tool]    def format(self, **kwargs) -> str:        # Get the intermediate steps (AgentAction, Observation tuples)        # Format them in a particular way        intermediate_steps = kwargs.pop("intermediate_steps")        thoughts = ""        for action, observation in intermediate_steps:            thoughts += action.log            thoughts += f"\nObservation: {observation}\nThought: "        # Set the agent_scratchpad variable to that value        kwargs["agent_scratchpad"] = thoughts        # Create a tools variable from the list of tools provided        kwargs["tools"] = "\n".join(            [f"{tool.name}: {tool.description}" for tool in self.tools]        )        # Create a list of tool names for the tools provided        kwargs["tool_names"] = ", ".join([tool.name for tool in self.tools])