From 3c622d54650225644b982c7e8c46b0076e07cc5c Mon Sep 17 00:00:00 2001 From: bucolucas Date: Sun, 18 Aug 2024 18:56:34 -0500 Subject: [PATCH] Add MetricsTool to telegram_inference_bot.py --- telegram_inference_bot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telegram_inference_bot.py b/telegram_inference_bot.py index fa0a39f..bb8c5c2 100644 --- a/telegram_inference_bot.py +++ b/telegram_inference_bot.py @@ -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 dotenv import load_dotenv from tools.base_tool import BaseTool +from tools.metrics_tool import MetricsTool from anthropic import Anthropic # Load environment variables @@ -38,10 +39,10 @@ conversation_history = {} processing_status = {} # Load tools -tools = [] +tools = [MetricsTool()] # Add MetricsTool instance tools_dir = os.path.join(os.path.dirname(__file__), 'tools') 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 = importlib.import_module(module_name) for name, obj in inspect.getmembers(module):