Spaces:
Running
Running
axeronis commited on
Commit ·
7e95eff
1
Parent(s): fc80520
fix: undefined variable ai_message_count -> ai_msg_count
Browse files
backend/app/api/webhook.py
CHANGED
|
@@ -1294,7 +1294,7 @@ async def process_ai_response_background(
|
|
| 1294 |
recent_ai_voice_count += 1
|
| 1295 |
|
| 1296 |
# FREQUENCY LIMIT: Only 1 voice per 5+ messages
|
| 1297 |
-
voice_allowed_by_frequency = recent_ai_voice_count < 1 or
|
| 1298 |
|
| 1299 |
if not ai_wants_voice and tenant.voice_enabled and not user_requested_no_voice and voice_allowed_by_frequency:
|
| 1300 |
# 1. FIRST MESSAGE - greeting (always voice for trust)
|
|
|
|
| 1294 |
recent_ai_voice_count += 1
|
| 1295 |
|
| 1296 |
# FREQUENCY LIMIT: Only 1 voice per 5+ messages
|
| 1297 |
+
voice_allowed_by_frequency = recent_ai_voice_count < 1 or ai_msg_count % 5 == 0
|
| 1298 |
|
| 1299 |
if not ai_wants_voice and tenant.voice_enabled and not user_requested_no_voice and voice_allowed_by_frequency:
|
| 1300 |
# 1. FIRST MESSAGE - greeting (always voice for trust)
|