Skip to main content
User Input allows you to mark specific tool parameters as user-provided. The agent fills in the rest of the arguments and invokes the tool; the run pauses so the user can supply values for the designated fields. Once the schema is filled and marked answered, resume with continue_run_async(). Use this for operations where the agent decides what to do but the user must supply who or when (e.g. email recipient, meeting date).

Quick Start

Core Concepts

Defining Tools That Require User Input

Use @tool(requires_user_input=True, user_input_fields=[...]) and list the parameter names that the user must supply:

User Input Schema

Each requirement exposes user_input_schema: a list of field dicts with name, optional field_type, and value. Set value for each field and then set requirement.tool_execution.answered = True before resuming. Example helper:

HITL Handler

Use a unified callback to fill user input during continuation:

Continuation Methods

Resume with run_id (Same Agent)

Resume with task (Same Agent)

Resume with run_id (New Agent - Cross-Process)

Resume with task (New Agent - Cross-Process)

Multiple User Input Tools

Loop-Based Handling

When the agent invokes multiple user-input tools, loop until there are no active requirements:

Using hitl_handler for Multiple Tools

Resolve the first pause, then pass hitl_handler so subsequent user-input pauses are filled automatically:

Cross-Process User Input

Resume in a different process (or new agent) after the user fills fields:

Important Notes

  • Direct Call Mode Only: HITL continuation only supports direct call mode. Streaming is not supported for continuation.
  • Requirements Parameter: When resuming with a new agent, pass requirements=output.requirements so filled user input is applied.
  • answered Flag: Set requirement.tool_execution.answered = True after filling all fields in user_input_schema.
  • pause_reason: When paused for user input, output.pause_reason == "user_input" and output.is_paused is True.
  • Persistent Storage: For cross-process scenarios, use persistent storage (e.g. SqliteDatabase).