AI topic summarize hangs (Gemini)

AI-generated summary

A user, Parker1090, is experiencing issues with the AI topic summarization feature using the Google Gemini 2.0 Flash plugin, which results in a hang and a 400 error related to an invalid JSON payload, specifically a problem with the response_schema. The error message points to an unrecognized json_schema field in the Gemini configuration. KhoiUSA provided a link to a similar issue (Summarize Topic with AI loads indefinitely, In valid JSON Payload Received?) with a possible solution and Parker1090 confirmed that the workaround fixes the issue temporarily.

Hello!

We’ve set up the AI plugin with Google Gemini 2.0 Flash and enabled summarize, spam detection, and AI helper.

Helper and spam seem to work fine - no problems at all there.

However, the summarize just hangs

Error log shows the below -

DiscourseAi::Completions::Endpoints::Gemini: status: 400 - body: {
  "error": {
    "code": 400,
    "message": "Invalid value at 'generation_config.response_schema.type' (type.googleapis.com/google.ai.generativelanguage.v1beta.Type), \"json_schema\"\nInvalid JSON payload received. Unknown name \"json_schema\" at 'generation_config.response_schema': Cannot find field.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "generation_config.response_schema.type",
            "description": "Invalid value at 'generation_config.response_schema.type' (type.googleapis.com/google.ai.generativelanguage.v1beta.Type), \"json_schema\""
          },
          {
            "field": "generation_config.response_schema",
            "description": "Invalid JSON payload received. Unknown name \"json_schema\" at 'generation_config.response_schema': Cannot find field."
          }
        ]
      }
    ]
  }
}

I have no experience with this, so any input is appreciated. It’s only the summarize feature that’s not working, everything else seems fine.

Thanks in advance

I recently encountered this as well, and a solution has been posted here that may help you: Summarize Topic with AI loads indefinitely, Invalid JSON Payload Received?

Ah, perfect. That does fix the issue for me. Hopefully the update will resolve it completely, but the workaround works for the time being.

Appreciate that :+1: