liveBook · Manning

HumanInputTool

As explained in Build a Multi-Agent System (from Scratch)

HumanInputTool is a book-specific callable tool that obtains input from a human operator during agent execution.

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

How Build a Multi-Agent System (from Scratch) covers it

How deep it goes
Defines the BaseTool interface, JSON-schema arguments, validation, and prompt rendering; identifies multi-agent synchronization as future work.
Examples
Demonstrates asking for a Hailstone-sequence starting number and optionally constraining responses with choices.
What it assumes
Assumes the framework’s BaseTool and ToolCall structures; defines the tool properties and argument schema.
What you can do after
Apply it by attaching HumanInputTool to an LLM agent so the agent can request operator input.
How it connects
Connects to BaseTool, ToolCall, ToolCallResult, and human-in-the-loop execution.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Multi-Agent System (from Scratch). The section links point to the parts of the book it draws on.