@@ -84,8 +84,8 @@ class HookProvider(Protocol):
84
84
```python
85
85
class MyHookProvider(HookProvider):
86
86
def register_hooks(self, registry: HookRegistry) -> None:
87
- hooks .add_callback(StartRequestEvent, self.on_request_start)
88
- hooks .add_callback(EndRequestEvent, self.on_request_end)
87
+ registry .add_callback(StartRequestEvent, self.on_request_start)
88
+ registry .add_callback(EndRequestEvent, self.on_request_end)
89
89
90
90
agent = Agent(hooks=[MyHookProvider()])
91
91
```
@@ -183,7 +183,7 @@ def invoke_callbacks(self, event: TInvokeEvent) -> TInvokeEvent:
183
183
"""Invoke all registered callbacks for the given event.
184
184
185
185
This method finds all callbacks registered for the event's type and
186
- invokes them in the appropriate order. For events with is_after_callback =True,
186
+ invokes them in the appropriate order. For events with should_reverse_callbacks =True,
187
187
callbacks are invoked in reverse registration order.
188
188
189
189
Args:
@@ -210,7 +210,7 @@ def get_callbacks_for(self, event: TEvent) -> Generator[HookCallback[TEvent], No
210
210
"""Get callbacks registered for the given event in the appropriate order.
211
211
212
212
This method returns callbacks in registration order for normal events,
213
- or reverse registration order for events that have is_after_callback =True.
213
+ or reverse registration order for events that have should_reverse_callbacks =True.
214
214
This enables proper cleanup ordering for teardown events.
215
215
216
216
Args:
0 commit comments