feat: support to initialize a tool from defined Tool attributes

This commit is contained in:
Lucas Gomide
2025-06-17 18:22:48 -03:00
parent db1e9e9b9a
commit b63a8f738c
2 changed files with 12 additions and 6 deletions

View File

@@ -476,7 +476,7 @@ def load_agent_from_repository(from_repository: str) -> Dict[str, Any]:
try:
module = importlib.import_module(tool["module"])
tool_class = getattr(module, tool["name"])
attributes[key].append(tool_class())
attributes[key].append(tool_class(**tool["init_params"]))
except Exception as e:
raise AgentRepositoryError(
f"Tool {tool['name']} could not be loaded: {e}"