7
7
8
8
from .tool_pool import ToolPool
9
9
10
+ # File prefix for configuration file paths
11
+ FILE_PREFIX = "file://"
12
+
10
13
# Minimum viable list of tools to enable agent building
11
14
# This list is experimental and will be revisited as tools evolve
12
15
DEFAULT_TOOLS = ["file_read" , "editor" , "http_request" , "shell" , "use_agent" ]
15
18
class AgentConfig :
16
19
"""Agent configuration with toAgent() method and ToolPool integration."""
17
20
18
- FILE_PREFIX = "file://"
19
-
20
21
def __init__ (self , config_source : str | dict [str , any ], tool_pool : "ToolPool | None" = None ):
21
22
"""Initialize AgentConfig from file path or dictionary.
22
23
@@ -26,11 +27,11 @@ def __init__(self, config_source: str | dict[str, any], tool_pool: "ToolPool | N
26
27
"""
27
28
if isinstance (config_source , str ):
28
29
# 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 } '" )
31
32
32
33
# Remove file:// prefix and load from file
33
- file_path = config_source .removeprefix (self . FILE_PREFIX )
34
+ file_path = config_source .removeprefix (FILE_PREFIX )
34
35
with open (file_path , 'r' ) as f :
35
36
config_data = json .load (f )
36
37
else :
0 commit comments