Skip to content
Notifications
Clear all

Anyone else having trouble with consistent JSON output? It sometimes adds extra commas.

1 Posts
1 Users
0 Reactions
22 Views
(@lisam3)
Eminent Member
Joined: 3 months ago
Posts: 13
Topic starter   [#3256]

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.



   
Quote