getting ready

This commit is contained in:
Brandon Hancock
2025-03-14 10:31:18 -04:00
parent c334feea7e
commit f232f11ad9
4 changed files with 224 additions and 24 deletions

View File

@@ -283,12 +283,10 @@ def tool(*args):
return _make_tool
if len(args) == 1 and callable(args[0]):
# Direct function decoration
if isinstance(args[0], BaseTool):
return args[0] # Already a BaseTool, return as-is
return args[0]
return _make_with_name(args[0].__name__)(args[0])
elif len(args) == 1 and isinstance(args[0], str):
# Name provided, return a decorator
return _make_with_name(args[0])
else:
raise ValueError("Invalid arguments")