Skip to content

Commit ca06723

Browse files
committed
fix: set back some parameters to be non-optional
1 parent bfdfaa8 commit ca06723

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/strands/experimental/hooks/events.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This module defines the events that are emitted as Agents run through the lifecycle of a request.
44
"""
55

6-
from dataclasses import dataclass
6+
from dataclasses import dataclass, field
77
from typing import Any, Optional
88

99
from ...hooks import HookEvent
@@ -29,8 +29,8 @@ class BeforeToolInvocationEvent(HookEvent):
2929
"""
3030

3131
selected_tool: Optional[AgentTool] = None
32-
tool_use: Optional[ToolUse] = None
33-
invocation_state: dict[str, Any] = None
32+
tool_use: ToolUse
33+
invocation_state: dict[str, Any]
3434

3535
def _can_write(self, name: str) -> bool:
3636
return name in ["selected_tool", "tool_use"]
@@ -55,10 +55,10 @@ class AfterToolInvocationEvent(HookEvent):
5555
or an Exception if the tool execution failed.
5656
"""
5757

58-
selected_tool: Optional[AgentTool] = None
59-
tool_use: Optional[ToolUse] = None
60-
invocation_state: dict[str, Any] = None
61-
result: Optional[ToolResult] = None
58+
selected_tool: Optional[AgentTool]=None
59+
tool_use: ToolUse
60+
invocation_state: dict[str, Any]
61+
result: ToolResult
6262
exception: Optional[Exception] = None
6363

6464
def _can_write(self, name: str) -> bool:

0 commit comments

Comments
 (0)