您的 API 密钥无效,因此它没有执行任何测试。
如果您在 https://www.foodtalkcentral.com/admin/plugins/discourse-ai/ai-spam 进行测试并粘贴该 URL,您将收到 500 错误。如果您深入查看 /var/discourse/shared/web-only/log/rails/production.log 中的日志并搜索“ 500 ”,您会看到
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."
}
]
}
}