Files
sales-trainer/backend/app/services/persona_generator.py
Macky 2b414d13b7 fix(analyze): don't hard-fail when LLM generates <15 personas (retry + accept)
Live test found: deepseek returned 14/15 personas -> whole analyze 500'd, breaking the
'กดสร้าง -> auto-analyze' flow. Now generate() retries up to 3x with a nudge, and accepts
a short result (>=8 personas) instead of crashing — admin can top up the rest with
'สร้างบุคคลต้นแบบเพิ่มเติม'. Also default tolerance/recontact on generated personas.
All backend suites pass.
2026-08-09 12:23:15 +07:00

3.6 KiB