Spaces:
Running
Running
axeronis commited on
Commit ·
2a7e440
1
Parent(s): fd47d06
Fix: Use correct variable name conversation_history in escalation check
Browse files
backend/app/api/webhook.py
CHANGED
|
@@ -1340,8 +1340,8 @@ async def process_ai_response_background(
|
|
| 1340 |
|
| 1341 |
# Build conversation history for analysis
|
| 1342 |
conv_history = []
|
| 1343 |
-
if
|
| 1344 |
-
for msg in
|
| 1345 |
conv_history.append({
|
| 1346 |
"sender_type": msg.sender_type,
|
| 1347 |
"content": msg.content or ""
|
|
|
|
| 1340 |
|
| 1341 |
# Build conversation history for analysis
|
| 1342 |
conv_history = []
|
| 1343 |
+
if conversation_history:
|
| 1344 |
+
for msg in conversation_history[-10:]: # Last 10 messages
|
| 1345 |
conv_history.append({
|
| 1346 |
"sender_type": msg.sender_type,
|
| 1347 |
"content": msg.content or ""
|