Add MetricsTool to telegram_inference_bot.py
This commit is contained in:
@@ -8,6 +8,7 @@ from telegram import error as TelegramErrors, Update, __version__ as telegram_ve
|
|||||||
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes, CallbackQueryHandler
|
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes, CallbackQueryHandler
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from tools.base_tool import BaseTool
|
from tools.base_tool import BaseTool
|
||||||
|
from tools.metrics_tool import MetricsTool
|
||||||
from anthropic import Anthropic
|
from anthropic import Anthropic
|
||||||
|
|
||||||
# Load environment variables
|
# Load environment variables
|
||||||
@@ -38,10 +39,10 @@ conversation_history = {}
|
|||||||
processing_status = {}
|
processing_status = {}
|
||||||
|
|
||||||
# Load tools
|
# Load tools
|
||||||
tools = []
|
tools = [MetricsTool()] # Add MetricsTool instance
|
||||||
tools_dir = os.path.join(os.path.dirname(__file__), 'tools')
|
tools_dir = os.path.join(os.path.dirname(__file__), 'tools')
|
||||||
for filename in os.listdir(tools_dir):
|
for filename in os.listdir(tools_dir):
|
||||||
if filename.endswith('.py') and filename != '__init__.py' and filename != 'base_tool.py':
|
if filename.endswith('.py') and filename not in ['__init__.py', 'base_tool.py', 'metrics_tool.py']:
|
||||||
module_name = f'tools.{filename[:-3]}'
|
module_name = f'tools.{filename[:-3]}'
|
||||||
module = importlib.import_module(module_name)
|
module = importlib.import_module(module_name)
|
||||||
for name, obj in inspect.getmembers(module):
|
for name, obj in inspect.getmembers(module):
|
||||||
|
|||||||
Reference in New Issue
Block a user