use await
Browse files- chatbot/plugins/chat.py +2 -2
chatbot/plugins/chat.py
CHANGED
@@ -167,10 +167,10 @@ gen = genai.Client(api_key=GOOGLE_API_KEY)
|
|
167 |
|
168 |
async def search_auto_by_cohere(user_id, prompt):
|
169 |
COHERE_API_KEY = os.environ.get("COHERE_API_KEY")
|
170 |
-
co = cohere.
|
171 |
chat_history = await db._get_cohere_chat_from_db(user_id)
|
172 |
chat_history.append({"role": "User", "message": prompt})
|
173 |
-
stream = co.chat_stream(
|
174 |
model='command-r-08-2024',
|
175 |
message=prompt,
|
176 |
temperature=0.3,
|
|
|
167 |
|
168 |
async def search_auto_by_cohere(user_id, prompt):
|
169 |
COHERE_API_KEY = os.environ.get("COHERE_API_KEY")
|
170 |
+
co = cohere.AsyncClient(api_key=COHERE_API_KEY)
|
171 |
chat_history = await db._get_cohere_chat_from_db(user_id)
|
172 |
chat_history.append({"role": "User", "message": prompt})
|
173 |
+
stream = await co.chat_stream(
|
174 |
model='command-r-08-2024',
|
175 |
message=prompt,
|
176 |
temperature=0.3,
|