~/langchain/langchain/callbacks/human.py:48, in HumanApprovalCallbackHandler.on_tool_start(self, serialized, input_str, run_id, parent_run_id, **kwargs)         38 def on_tool_start(         39     self,         40     serialized: Dict[str, Any],       (...)         45     **kwargs: Any,         46 ) -> Any:         47     if self._should_check(serialized) and not self._approve(input_str):    ---> 48         raise HumanRejectedException(         49             f"Inputs {input_str} to tool {serialized} were rejected."         50         )    HumanRejectedException: Inputs ls /private to tool {'name': 'terminal', 'description': 'Run shell commands on this MacOS machine.'} were rejected.PreviousDefining Custom ToolsNextMulti-Input ToolsAdding Human ApprovalConfiguring Human ApprovalCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
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. ->: ~/langchain/langchain/callbacks/human.py:48, in HumanApprovalCallbackHandler.on_tool_start(self, serialized, input_str, run_id, parent_run_id, **kwargs)         38 def on_tool_start(         39     self,         40     serialized: Dict[str, Any],       (...)         45     **kwargs: Any,         46 ) -> Any:         47     if self._should_check(serialized) and not self._approve(input_str):    ---> 48         raise HumanRejectedException(         49             f"Inputs {input_str} to tool {serialized} were rejected."         50         )    HumanRejectedException: Inputs ls /private to tool {'name': 'terminal', 'description': 'Run shell commands on this MacOS machine.'} were rejected.PreviousDefining Custom ToolsNextMulti-Input ToolsAdding Human ApprovalConfiguring Human ApprovalCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.