Discourse AI - Spam detection

Your API key is invalid, so it’s not doing any tests.

If you do a test at https://www.foodtalkcentral.com/admin/plugins/discourse-ai/ai-spam and paste in that URL you get a 500 error. If you wade into the logs in
/var/discourse/shared/web-only/log/rails/production.log and search for " 500 " you’ll see

Completed 200 OK in 399ms (Views: 123.1ms | ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 22.9ms)
DiscourseAi::Completions::Endpoints::Gemini: status: 400 - body: {
  "error": {
    "code": 400,
    "message": "API key not valid. Please pass a valid API key.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "API_KEY_INVALID",
        "domain": "googleapis.com",
        "metadata": {
          "service": "generativelanguage.googleapis.com"
        }
      },
      {
        "@type": "type.googleapis.com/google.rpc.LocalizedMessage",
        "locale": "en-US",
        "message": "API key not valid. Please pass a valid API key."
      }
    ]
  }
}
1 Like