From c255d4cb15f799f3593060a10671c1ca7a2b9793 Mon Sep 17 00:00:00 2001 From: Karim Iskakov Date: Tue, 17 Jan 2023 03:27:34 -0600 Subject: [PATCH] Add /mode to help --- README.md | 1 + bot.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9353a6..dd24d87 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This repo is ChatGPT re-created with GPT-3.5 LLM as Telegram Bot. **And it works - Different chat modes (👩🏼‍🎓 Assistant, 👩🏼‍💻 Code Assistant, 🎬 Movie Expert) - `/retry` command to regenerate last bot answer - Control of allowed Telegram users +- *Next up*: warn user that the size of the context is close to the maximum ## Setup 1. Get your [OpenAI API](https://openai.com/api/) key diff --git a/bot.py b/bot.py index 846b91e..2cd38b2 100644 --- a/bot.py +++ b/bot.py @@ -28,6 +28,7 @@ logger = logging.getLogger(__name__) HELP_MESSAGE = """Commands: ⚪ /retry – regenerate last bot answer ⚪ /reset – reset chat context +⚪ /mode – select chat mode ⚪ /help – show help """ @@ -81,7 +82,7 @@ async def message_handle(update: Update, context: CallbackContext, message=None, error_text = f"Something went wrong during completion. Reason: {e}" logger.error(error_text) await update.message.reply_text(error_text) - + async def reset_handle(update: Update, context: CallbackContext): utils.init_user(update, context)