Skip to content

Commit 59a9245

Browse files
committed
fix: type errors
1 parent 46e214c commit 59a9245

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/strands/hooks/registry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from typing import TYPE_CHECKING, Any, Callable, Generator, Protocol, Type, TypeVar
1212

1313
if TYPE_CHECKING:
14-
from strands import Agent
14+
from ..agent import Agent
1515

1616

1717
@dataclass
@@ -100,9 +100,9 @@ class HookRegistry:
100100
cleanup events, and provides type-safe event dispatching.
101101
"""
102102

103-
def __init__(self):
103+
def __init__(self) -> None:
104104
"""Initialize an empty hook registry."""
105-
self._registered_callbacks = {}
105+
self._registered_callbacks: dict[Type, list[HookCallback]] = {}
106106

107107
def add_callback(self, event_type: Type, callback: HookCallback) -> None:
108108
"""Register a callback function for a specific event type.

tests/strands/agent/test_agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from unittest.mock import call
77

88
import pytest
9-
from mocks.mock_hook_provider import MockHookProvider
109
from pydantic import BaseModel
1110

1211
import strands
@@ -20,6 +19,8 @@
2019
from strands.types.content import Messages
2120
from strands.types.exceptions import ContextWindowOverflowException, EventLoopException
2221

22+
from ..mocks.mock_hook_provider import MockHookProvider
23+
2324

2425
@pytest.fixture
2526
def mock_randint():

0 commit comments

Comments
 (0)