The Gemini error was fixed in:
https://github.com/discourse/discourse-ai/pull/1340
It was expecting a slightly different format for the JSON schema. Also, we’ll now treat the completion as plain text if the model doesn’t return valid JSON when asked to.