From 3e0a63ad897e250b5159e2e072ac3ec52b3cfbe2 Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sun, 18 Aug 2024 18:01:54 -0500 Subject: [PATCH] merge conflicts resolved --- telegram_inference_bot.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/telegram_inference_bot.py b/telegram_inference_bot.py index 1aefac0..527d05b 100644 --- a/telegram_inference_bot.py +++ b/telegram_inference_bot.py @@ -53,17 +53,10 @@ functions = [] for tool in tools: functions.extend(tool.get_functions()) -def get_keyboard(): - keyboard = [ - ['/status', '/reset'] - ] - return ReplyKeyboardMarkup(keyboard, resize_keyboard=True) - async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: logging.info("Bot started") await update.message.reply_text( - "Hello! I'm your AI assistant. How can I help you today? You can send me images and then ask questions about them.", - reply_markup=get_keyboard() + "Hello! I'm your AI assistant. How can I help you today? You can send me images and then ask questions about them." ) async def clear(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: @@ -74,7 +67,7 @@ async def clear(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: tool.clear() logging.info(f"Cleared conversation history and image for user {user_id}") - await update.message.reply_text("Conversation history and image cleared. Let's start fresh!", reply_markup=get_keyboard()) + await update.message.reply_text("Conversation history and image cleared. Let's start fresh!") async def update_status_message(context: ContextTypes.DEFAULT_TYPE, chat_id: int, message_id: int, status: str): keyboard = [ @@ -162,7 +155,7 @@ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE) -> except Exception as e: logging.error(f"An error occurred: {str(e)}") - await update.message.reply_text("Sorry, an error occurred while processing your request.", reply_markup=get_keyboard()) + await update.message.reply_text("Sorry, an error occurred while processing your request.") def call_tool(function_call): function_name = function_call.name @@ -198,7 +191,7 @@ def get_claude_response(messages): return response async def status(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: - await update.message.reply_text("Currently using claude-3-5-sonnet-20240620", reply_markup=get_keyboard()) + await update.message.reply_text("Currently using claude-3-5-sonnet-20240620") async def abort_processing(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: query = update.callback_query @@ -223,8 +216,6 @@ def main() -> None: # Add handlers application.add_handler(CommandHandler("start", start)) application.add_handler(CommandHandler("clear", clear)) - application.add_handler(CommandHandler("switch", switch)) - application.add_handler(CommandHandler("toggle", switch_providers)) application.add_handler(CommandHandler("status", status)) application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_message)) application.add_handler(CallbackQueryHandler(abort_processing, pattern='^abort$'))