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:
parent
3e85858d41
commit
4abdc88286
1 changed files with 1 additions and 1 deletions
|
|
@ -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, \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue