12 lines
328 B
Python
12 lines
328 B
Python
class ToolManager:
|
|
def __init__(self):
|
|
self.tools = {}
|
|
|
|
def register_tool(self, name, tool_func):
|
|
self.tools[name] = tool_func
|
|
|
|
def execute_tool(self, name, **kwargs):
|
|
if name not in self.tools:
|
|
raise ValueError(f"Tool {name} not found")
|
|
return self.tools[name](**kwargs)
|