User Control Flows
User Confirmation Required
This example demonstrates how to implement human-in-the-loop functionality by requiring user confirmation before executing tool calls.
Code
cookbook/agent_concepts/user_control_flows/confirmation_required.py
Usage
1
Create a virtual environment
Open the Terminal
and create a python virtual environment.
2
Set your API key
3
Install libraries
4
Run Example
Key Features
- Uses
@tool(requires_confirmation=True)
to mark tools that need user confirmation - Demonstrates how to continue agent execution after user input
Use Cases
- Confirming sensitive operations before execution