tools: add tools.file.enable to toggle built-in filesystem tools (default true)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from types import SimpleNamespace
|
||||
|
||||
from nanobot.config.schema import Config, ToolsConfig
|
||||
from nanobot.agent.tools.filesystem import FileToolsConfig, ReadFileTool
|
||||
|
||||
|
||||
def test_file_tools_enabled_by_default():
|
||||
assert FileToolsConfig().enable is True
|
||||
assert Config().tools.file.enable is True
|
||||
|
||||
|
||||
def test_file_tool_gate_follows_flag():
|
||||
cfg = ToolsConfig()
|
||||
cfg.file.enable = False
|
||||
assert ReadFileTool.enabled(SimpleNamespace(config=cfg)) is False
|
||||
assert ReadFileTool.enabled(SimpleNamespace(config=ToolsConfig())) is True
|
||||
Reference in New Issue
Block a user