Automatic Context for Custom Methods
All custom methods automatically have full agent context! The framework automatically detects and wraps your custom methods during initialization, ensuringgetCurrentAgent() works seamlessly everywhere.
How It Works
- Scans your agent class for custom methods
- Wraps them with agent context during initialization
- Ensures
getCurrentAgent()works in all external functions called from your methods
Real-World Example
Built-in vs Custom Methods
- Built-in methods (onRequest, onEmail, onStateChanged): Already have context
- Custom methods (your methods): Automatically wrapped during initialization
- External functions: Access context through
getCurrentAgent()