HumanInputTool lets an LLM agent pause for input from a human operator when a task becomes ambiguous. The agent chooses when to call it, like any other tool, so it adds human input without changing the processing loop. section 8.2
The tool’s implementation follows the framework’s BaseTool interface:
- It defines name, description, and parameters_json_schema properties, plus __call__(). Its arguments are a required prompt string and optional choices. section 8.2
- __call__() validates the ToolCall arguments against the schema. A helper renders the prompt with Rich and, when choices are supplied, presents them as constrained responses. section 8.2
Requesting a starting number
An agent computing a Hailstone sequence can call HumanInputTool to ask the operator for the starting number before beginning. section 8.2
Figure 8.5 The UML class diagram for HumanInputTool for supporting Tool-Based HITL

The UML diagram shows HumanInputTool’s class structure within the tool framework. section 8.2
