AI topic summarize hangs (Gemini)

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

1 Like

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?

1 Like

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:

1 Like