Skip to content

Commit 9258fb2

Browse files
committed
refactor: move FILE_PREFIX constant to top with DEFAULT_TOOLS
- Organize module constants together at the top - Keep FILE_PREFIX and DEFAULT_TOOLS in same location for consistency 🤖 Assisted by Amazon Q Developer
1 parent 5bc1cd3 commit 9258fb2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/strands/experimental/agent_config.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
from .tool_pool import ToolPool
99

10+
# File prefix for configuration file paths
11+
FILE_PREFIX = "file://"
12+
1013
# Minimum viable list of tools to enable agent building
1114
# This list is experimental and will be revisited as tools evolve
1215
DEFAULT_TOOLS = ["file_read", "editor", "http_request", "shell", "use_agent"]
@@ -15,8 +18,6 @@
1518
class AgentConfig:
1619
"""Agent configuration with toAgent() method and ToolPool integration."""
1720

18-
FILE_PREFIX = "file://"
19-
2021
def __init__(self, config_source: str | dict[str, any], tool_pool: "ToolPool | None" = None):
2122
"""Initialize AgentConfig from file path or dictionary.
2223
@@ -26,11 +27,11 @@ def __init__(self, config_source: str | dict[str, any], tool_pool: "ToolPool | N
2627
"""
2728
if isinstance(config_source, str):
2829
# Require file:// prefix for file paths
29-
if not config_source.startswith(self.FILE_PREFIX):
30-
raise ValueError(f"File paths must be prefixed with '{self.FILE_PREFIX}'")
30+
if not config_source.startswith(FILE_PREFIX):
31+
raise ValueError(f"File paths must be prefixed with '{FILE_PREFIX}'")
3132

3233
# Remove file:// prefix and load from file
33-
file_path = config_source.removeprefix(self.FILE_PREFIX)
34+
file_path = config_source.removeprefix(FILE_PREFIX)
3435
with open(file_path, 'r') as f:
3536
config_data = json.load(f)
3637
else:

0 commit comments

Comments
 (0)