Gemini's "too many states for serving" error: what triggered it for us, and two fixes
typescript
dev.to
If you landed here from a search, this is probably the error you're looking at: The specified schema produces a constraint that has too many states for serving. It comes back as a 400 INVALID_ARGUMENT when you pass a responseSchema to Gemini. We hit it with the schema we use to generate forms, and the uncomfortable part is how long it went unnoticed. How it hid Gemini wasn't our primary model. It sat second in a fallback chain, behind a faster provider. So the error only mattered