Clarify lifecycle and built-in callbacks

This commit is contained in:
James Murdza
2025-08-28 08:37:53 -04:00
parent b0ed02d974
commit 63b7d1ae0d
2 changed files with 7 additions and 13 deletions

View File

@@ -42,11 +42,4 @@ Called when responses are received from agent loop.
- `on_screenshot(screenshot, name)` - When screenshots are taken
### 10. `on_run_end(kwargs, old_items, new_items)`
Called when agent run completes. Finalize tracking, save trajectories.
## Built-in Callbacks
- **ImageRetentionCallback**: Limits recent images in context
- **BudgetManagerCallback**: Stops execution when budget exceeded
- **TrajectorySaverCallback**: Saves conversation trajectories
- **LoggingCallback**: Logs agent activities
Called when agent run completes. Finalize tracking, save trajectories.

View File

@@ -4,11 +4,12 @@ title: Callbacks
Callbacks in the Agent SDK provide hooks into the agent's lifecycle, allowing for custom functionality to be executed at various stages of an agent's run. They enable extensibility by allowing developers to integrate their own logic for tasks such as logging, cost management, and data anonymization.
This section details the various callbacks available in the Agent SDK.
The callback lifecycle is described in [Agent Lifecycle](callbacks/agent-lifecycle).
## Available Callbacks
## Built-in Callbacks
- [Cost Saving](callbacks/cost-saving)
- [Logging](callbacks/logging)
- [BudgetManagerCallback](callbacks/cost-saving): Stops execution when budget exceeded
- [LoggingCallback](callbacks/trajectories): Logs agent activities
- **ImageRetentionCallback**: Limits recent images in context
- **TrajectorySaverCallback**: Saves conversation trajectories
- [PII Anonymization](callbacks/pii-anonymization)
- [Trajectories](callbacks/trajectories)