Skip to content

Commit 2db5226

Browse files
fix(doc): replace invalid Hook names in doc comment with BeforeInvocationEvent & AfterInvocationEvent (#782)
Co-authored-by: deepyes02 <deepesh.dhakal@digitalwallet.co.jp>
1 parent 4dee33b commit 2db5226

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/strands/hooks/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
Example Usage:
99
```python
1010
from strands.hooks import HookProvider, HookRegistry
11-
from strands.hooks.events import StartRequestEvent, EndRequestEvent
11+
from strands.hooks.events import BeforeInvocationEvent, AfterInvocationEvent
1212
1313
class LoggingHooks(HookProvider):
1414
def register_hooks(self, registry: HookRegistry) -> None:
15-
registry.add_callback(StartRequestEvent, self.log_start)
16-
registry.add_callback(EndRequestEvent, self.log_end)
15+
registry.add_callback(BeforeInvocationEvent, self.log_start)
16+
registry.add_callback(AfterInvocationEvent, self.log_end)
1717
18-
def log_start(self, event: StartRequestEvent) -> None:
18+
def log_start(self, event: BeforeInvocationEvent) -> None:
1919
print(f"Request started for {event.agent.name}")
2020
21-
def log_end(self, event: EndRequestEvent) -> None:
21+
def log_end(self, event: AfterInvocationEvent) -> None:
2222
print(f"Request completed for {event.agent.name}")
2323
2424
# Use with agent

0 commit comments

Comments
 (0)