User Control Flows
External Tool Execution
This example demonstrates how to execute tool calls outside of the agent’s control, allowing for custom execution logic and security measures.
Code
cookbook/agent_concepts/user_control_flows/external_tool_execution.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(external_execution=True)
to mark tools that need external execution - Demonstrates how to handle tool execution results
Use Cases
- Executing sensitive operations outside agent control
- Executing long-running operations outside agent control