Skip to content

Commit 226f351

Browse files
committed
refactor: use native Python typing instead of typing module
- Replace Union[A, B] with A | B - Replace Optional[T] with T | None - Replace List[T] with list[T] - Replace Any with any - Use collections.abc.Callable instead of typing.Callable - Maintain TYPE_CHECKING for circular import resolution 🤖 Assisted by Amazon Q Developer
1 parent a2dad11 commit 226f351

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/strands/experimental/agent_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Experimental agent configuration with enhanced instantiation patterns."""
44

55
import json
6-
from typing import Any, Optional, Union, TYPE_CHECKING
6+
from typing import TYPE_CHECKING
77

88
# Avoid circular import: experimental/agent_config.py -> agent.agent ->
99
# event_loop.event_loop -> experimental.hooks -> experimental.__init__.py -> AgentConfig
@@ -14,7 +14,7 @@
1414
class AgentConfig:
1515
"""Agent configuration with toAgent() method and ToolPool integration."""
1616

17-
def __init__(self, config_source: Union[str, dict[str, Any]]):
17+
def __init__(self, config_source: str | dict[str, any]):
1818
"""Initialize AgentConfig from file path or dictionary.
1919
2020
Args:
@@ -45,7 +45,7 @@ def tool_pool(self) -> "ToolPool":
4545
"""
4646
return self._tool_pool
4747

48-
def toAgent(self, tools: Optional["ToolPool"] = None, **kwargs: Any) -> "Agent":
48+
def toAgent(self, tools: "ToolPool" | None = None, **kwargs: any) -> "Agent":
4949
"""Create an Agent instance from this configuration.
5050
5151
Args:

0 commit comments

Comments
 (0)