Update Akeno/plugins/cohere.py
Browse files- Akeno/plugins/cohere.py +2 -4
Akeno/plugins/cohere.py
CHANGED
@@ -29,7 +29,6 @@ async def coheres_(c: Client, message: Message):
|
|
29 |
)
|
30 |
return
|
31 |
chat_history.append({"role": "USER", "message": prompt})
|
32 |
-
pro = await message.edit_text("<code>Processing...</code>")
|
33 |
response = co.chat(
|
34 |
chat_history=chat_history,
|
35 |
model="command-r-plus",
|
@@ -43,14 +42,13 @@ async def coheres_(c: Client, message: Message):
|
|
43 |
document="chat.txt",
|
44 |
disable_notification=True
|
45 |
)
|
46 |
-
await pro.delete()
|
47 |
os.remove("chat.txt")
|
48 |
else:
|
49 |
-
await message.
|
50 |
chat_history.append({"role": "CHATBOT", "message": output})
|
51 |
await db._update_cohere_chat_in_db(user_id, chat_history)
|
52 |
except Exception as e:
|
53 |
-
await message.
|
54 |
|
55 |
module = modules_help.add_module("cohere", __file__)
|
56 |
module.add_command("cohere", "to question from cohere ai.")
|
|
|
29 |
)
|
30 |
return
|
31 |
chat_history.append({"role": "USER", "message": prompt})
|
|
|
32 |
response = co.chat(
|
33 |
chat_history=chat_history,
|
34 |
model="command-r-plus",
|
|
|
42 |
document="chat.txt",
|
43 |
disable_notification=True
|
44 |
)
|
|
|
45 |
os.remove("chat.txt")
|
46 |
else:
|
47 |
+
await message.reply_text(output, disable_web_page_preview=True)
|
48 |
chat_history.append({"role": "CHATBOT", "message": output})
|
49 |
await db._update_cohere_chat_in_db(user_id, chat_history)
|
50 |
except Exception as e:
|
51 |
+
await message.reply_text(f"An error occurred: {e}")
|
52 |
|
53 |
module = modules_help.add_module("cohere", __file__)
|
54 |
module.add_command("cohere", "to question from cohere ai.")
|