From c40ac041089c00ae9255ad59ae512fec2bc7b2c9 Mon Sep 17 00:00:00 2001 From: thedragonsinn <98635854+thedragonsinn@users.noreply.github.com> Date: Mon, 12 Feb 2024 18:04:04 +0530 Subject: [PATCH] replace api key link. --- app/plugins/misc/gemini.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/plugins/misc/gemini.py b/app/plugins/misc/gemini.py index 1384fee..f697634 100644 --- a/app/plugins/misc/gemini.py +++ b/app/plugins/misc/gemini.py @@ -20,7 +20,7 @@ async def basic_check(message: Message): if not Config.GEMINI_API_KEY: await message.reply( "Gemini API KEY not found." - "\nGet it HERE " + "\nGet it HERE " "and set GEMINI_API_KEY var." ) return @@ -71,6 +71,8 @@ async def ai_chat(bot: BOT, message: Message): USAGE: .load_history {question} [reply to history document] """ + if not (await basic_check(message)): # fmt:skip + return reply = message.replied if ( not message.input @@ -84,10 +86,10 @@ async def ai_chat(bot: BOT, message: Message): ) return resp = await message.reply("Loading History...") + doc = (await reply.download(in_memory=True)).getbuffer() + history = pickle.loads(doc) + await resp.edit("History Loaded... Resuming chat") try: - doc = (await reply.download(in_memory=True)).getbuffer() - history = pickle.loads(doc) - await resp.edit("History Loaded... Resuming chat") chat = MODEL.start_chat(history=history) await do_convo(chat=chat, message=message) except TimeoutError: