I'm evaluating HuggingChat for a small task: generating structured data from customer support emails to import into our CRM.
My prompt is very clear, asking for a JSON array of objects with specific keys like `customer_id`, `issue_summary`. Most of the time it works, but about 30% of the responses have formatting errors.
Common issues I've seen:
* A trailing comma after the last object in the array
* Sometimes keys are missing quotes
* Inconsistent indentation that breaks my simple parser
I'm using a straightforward system prompt: "You are a data formatting assistant. Always output valid JSON."
Has anyone found a reliable way to get consistently valid JSON? Are there specific model settings or prompt phrasing that helps? I need this to be automated, so manual fixing isn't an option.