Update Akeno/plugins/cohere.py
Browse files- Akeno/plugins/cohere.py +2 -2
Akeno/plugins/cohere.py
CHANGED
@@ -16,7 +16,7 @@ async def coheres_(c: Client, message: Message):
|
|
16 |
status_key = await db.get_env(ENV_TEMPLATE.cohere_api_key)
|
17 |
if not status_key:
|
18 |
return await message.reply_text("Required `.setvar COHERE_API_KEY xxxx`")
|
19 |
-
co = cohere.
|
20 |
try:
|
21 |
user_id = message.from_user.id
|
22 |
chat_history = await db._get_cohere_chat_from_db(user_id)
|
@@ -30,7 +30,7 @@ async def coheres_(c: Client, message: Message):
|
|
30 |
)
|
31 |
return
|
32 |
chat_history.append({"role": "USER", "message": prompt})
|
33 |
-
response = co.chat(
|
34 |
chat_history=chat_history,
|
35 |
model="command-r-plus",
|
36 |
message=prompt
|
|
|
16 |
status_key = await db.get_env(ENV_TEMPLATE.cohere_api_key)
|
17 |
if not status_key:
|
18 |
return await message.reply_text("Required `.setvar COHERE_API_KEY xxxx`")
|
19 |
+
co = cohere.AsyncClient(api_key=status_key)
|
20 |
try:
|
21 |
user_id = message.from_user.id
|
22 |
chat_history = await db._get_cohere_chat_from_db(user_id)
|
|
|
30 |
)
|
31 |
return
|
32 |
chat_history.append({"role": "USER", "message": prompt})
|
33 |
+
response = await co.chat(
|
34 |
chat_history=chat_history,
|
35 |
model="command-r-plus",
|
36 |
message=prompt
|