fix(backend): request minified JSON from Gemini to avoid token truncation

Pretty-printed JSON wastes 2-3x tokens on indentation/newlines.
Minified output fits more data (e.g. long INCI lists) within the
8192 output token limit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Piotr Oleszczyk 2026-02-28 21:49:26 +01:00
parent 3e85858d41
commit 4abdc88286

View file

@ -227,7 +227,7 @@ Given raw text (product page copy, ingredient list, label scan, etc.), \
extract structured product data and return it as a single JSON object. extract structured product data and return it as a single JSON object.
RULES: RULES:
- Return ONLY raw JSON no markdown code fences, no explanation, no preamble. - Return ONLY raw JSON no markdown code fences, no explanation, no preamble, no indentation or extra whitespace (minified).
- Omit any field you cannot confidently determine from the text. Do not guess. - Omit any field you cannot confidently determine from the text. Do not guess.
- All enum values must exactly match the allowed strings listed below. - All enum values must exactly match the allowed strings listed below.
- For INCI lists: return each ingredient as a separate string in the array, \ - For INCI lists: return each ingredient as a separate string in the array, \