From b56a5e75672a350f341370060d1be40785e2bae0 Mon Sep 17 00:00:00 2001 From: deepyes02 Date: Wed, 3 Sep 2025 11:47:40 +0900 Subject: [PATCH] Fix(doc): Replaced StartRequestEvent & EndRequestEvent with BeforeInvocationEvent & AfterInvocationEvent respectively in the docstring for api reference documentation --- src/strands/hooks/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/strands/hooks/__init__.py b/src/strands/hooks/__init__.py index 77be9d64e..b98e95a6e 100644 --- a/src/strands/hooks/__init__.py +++ b/src/strands/hooks/__init__.py @@ -8,17 +8,17 @@ Example Usage: ```python from strands.hooks import HookProvider, HookRegistry - from strands.hooks.events import StartRequestEvent, EndRequestEvent + from strands.hooks.events import BeforeInvocationEvent, AfterInvocationEvent class LoggingHooks(HookProvider): def register_hooks(self, registry: HookRegistry) -> None: - registry.add_callback(StartRequestEvent, self.log_start) - registry.add_callback(EndRequestEvent, self.log_end) + registry.add_callback(BeforeInvocationEvent, self.log_start) + registry.add_callback(AfterInvocationEvent, self.log_end) - def log_start(self, event: StartRequestEvent) -> None: + def log_start(self, event: BeforeInvocationEvent) -> None: print(f"Request started for {event.agent.name}") - def log_end(self, event: EndRequestEvent) -> None: + def log_end(self, event: AfterInvocationEvent) -> None: print(f"Request completed for {event.agent.name}") # Use with agent