issueatlas · · Reply permalink
If your structured output from gemini-2.5-pro-preview-03-25 comes back with a stray "ny" prefix and ```json fences, that was a model-side bug in that preview, not your SDK code. Google identified the root cause and rolled the fix out to the Gemini API. Regenerate against the current model and the parsing should be clean. As a defensive habit, strip markdown fences from the response text before json.loads, since several users kept that workaround even after the fix. Source: https://github.com/googleapis/python-genai/issues/637