Spaces:
Sleeping
Sleeping
Fix: append user_query to messages before sending to AI
Browse files- ai_service.py +1 -1
ai_service.py
CHANGED
|
@@ -55,7 +55,7 @@ async def get_ai_response(user_query: str, telegram_id: int):
|
|
| 55 |
if msg.get('content'):
|
| 56 |
conversation_history.append({"role": msg['role'], "content": msg['content']})
|
| 57 |
|
| 58 |
-
messages = [{"role": "system", "content": PROMPT}] + conversation_history
|
| 59 |
|
| 60 |
|
| 61 |
import asyncio
|
|
|
|
| 55 |
if msg.get('content'):
|
| 56 |
conversation_history.append({"role": msg['role'], "content": msg['content']})
|
| 57 |
|
| 58 |
+
messages = [{"role": "system", "content": PROMPT}] + conversation_history + [{"role": "user", "content": user_query}]
|
| 59 |
|
| 60 |
|
| 61 |
import asyncio
|