- Add pre-hooks to tools for user confirmation
- Handle user input during tool execution
- Gracefully cancel operations based on user choice
- Confirming sensitive operations before execution
- Reviewing API calls before they’re made
- Validating data transformations
- Approving automated actions in critical systems
Code
human_in_the_loop.py
Usage
1
Create a virtual environment
Open the
Terminal
and create a python virtual environment.2
Install libraries
3
Run the agent