return resp.lower() in ("yes", "y")callbacks = [HumanApprovalCallbackHandler(should_check=_should_check, approve=_approve)]llm = OpenAI(temperature=0)tools = load_tools(["wikipedia", "llm-math", "terminal"], llm=llm)agent = initialize_agent(    tools,    llm,    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,)agent.run(    "It's 2023 now. How many years ago did Konrad Adenauer become Chancellor of Germany.",    callbacks=callbacks,)    'Konrad Adenauer became Chancellor of Germany in 1949, 74 years ago.'agent.run("print 'Hello World' in the terminal", callbacks=callbacks)    'Hello World'agent.run("list all directories in /private", callbacks=callbacks)    Do you approve of the following input? Anything except 'Y'/'Yes' (case-insensitive) will be treated as a no.        ls /private    no    ---------------------------------------------------------------------------    HumanRejectedException                    Traceback (most recent call last)    Cell In[39], line 1    ----> 1 agent.run("list all directories in /private", callbacks=callbacks)    File ~/langchain/langchain/chains/base.py:236, in Chain.run(self, callbacks, *args, **kwargs)        234     if len(args) != 1:        235         raise ValueError("`run` supports only one positional argument.")    --> 236     return self(args[0], callbacks=callbacks)[self.output_keys[0]]        238 if kwargs and not args:        239     return self(kwargs, callbacks=callbacks)[self.output_keys[0]]    File ~/langchain/langchain/chains/base.py:140, in Chain.__call__(self, inputs, return_only_outputs, callbacks)        138 except (KeyboardInterrupt, Exception) as e:        139     run_manager.on_chain_error(e)    --> 140     raise e        141 run_manager.on_chain_end(outputs)        142 return self.prep_outputs(inputs, outputs, return_only_outputs)    File ~/langchain/langchain/chains/base.py:134, in Chain.__call__(self, inputs, return_only_outputs, callbacks)        128 run_manager = callback_manager.on_chain_start(
This walkthrough demonstrates how to add human validation to any Tool. We'll do this using the HumanApprovalCallbackhandler.
This walkthrough demonstrates how to add human validation to any Tool. We'll do this using the HumanApprovalCallbackhandler. ->: return resp.lower() in ("yes", "y")callbacks = [HumanApprovalCallbackHandler(should_check=_should_check, approve=_approve)]llm = OpenAI(temperature=0)tools = load_tools(["wikipedia", "llm-math", "terminal"], llm=llm)agent = initialize_agent(    tools,    llm,    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,)agent.run(    "It's 2023 now. How many years ago did Konrad Adenauer become Chancellor of Germany.",    callbacks=callbacks,)    'Konrad Adenauer became Chancellor of Germany in 1949, 74 years ago.'agent.run("print 'Hello World' in the terminal", callbacks=callbacks)    'Hello World'agent.run("list all directories in /private", callbacks=callbacks)    Do you approve of the following input? Anything except 'Y'/'Yes' (case-insensitive) will be treated as a no.        ls /private    no    ---------------------------------------------------------------------------    HumanRejectedException                    Traceback (most recent call last)    Cell In[39], line 1    ----> 1 agent.run("list all directories in /private", callbacks=callbacks)    File ~/langchain/langchain/chains/base.py:236, in Chain.run(self, callbacks, *args, **kwargs)        234     if len(args) != 1:        235         raise ValueError("`run` supports only one positional argument.")    --> 236     return self(args[0], callbacks=callbacks)[self.output_keys[0]]        238 if kwargs and not args:        239     return self(kwargs, callbacks=callbacks)[self.output_keys[0]]    File ~/langchain/langchain/chains/base.py:140, in Chain.__call__(self, inputs, return_only_outputs, callbacks)        138 except (KeyboardInterrupt, Exception) as e:        139     run_manager.on_chain_error(e)    --> 140     raise e        141 run_manager.on_chain_end(outputs)        142 return self.prep_outputs(inputs, outputs, return_only_outputs)    File ~/langchain/langchain/chains/base.py:134, in Chain.__call__(self, inputs, return_only_outputs, callbacks)        128 run_manager = callback_manager.on_chain_start(