Chris4K's picture
Create tool_loader.py
873e601 verified
raw
history blame
511 Bytes
# tool_loader.py
import logging
from transformers import load_tool
class ToolLoader:
def __init__(self, tool_names):
self.tools = self.load_tools(tool_names)
def load_tools(self, tool_names):
loaded_tools = []
for tool_name in tool_names:
try:
tool = load_tool(tool_name)
loaded_tools.append(tool)
except Exception as e:
log_response(f"Error loading tool '{tool_name}': {e}")
return loaded_tools