gemini-1.5-flash returns a 400 Bad Request when using the Generative Language API (Gemini) #5244
-
What happened?gemini-1.5-flash returns a 400 Bad Request when using the Generative Language API (Gemini). Steps to ReproduceThis will always occur when you make a request using gemini-1.5-flash. What browsers are you seeing the problem on?No response Relevant log outputdebug log
2025-01-10T04:18:08.455Z debug: [AskController]
{
text: "Test Message",
conversationId: null,
// 1 example(s)
examples: [{"input":{"content":""},"output":{"content":""}}],
endpoint: "google",
resendFiles: true,
modelOptions.model: "gemini-1.5-flash",
modelsConfig: "exists",
}
2025-01-10T04:18:08.459Z debug: [BaseClient] Loading history:
{
conversationId: "b4e45862-ff99-4b16-adfe-a3e59d243b19",
parentMessageId: "00000000-0000-0000-0000-000000000000",
}
2025-01-10T04:18:08.465Z debug: Creating GenAI client
2025-01-10T04:18:08.482Z debug: [saveConvo] api/app/clients/BaseClient.js - saveMessageToDatabase #saveConvo
2025-01-10T04:18:09.246Z error: [handleAbortError] AI response error; aborting request: [GoogleGenerativeAI Erro
r]: Error fetching from https://generativelanguage.googleapis.com/v1be... [truncated]
2025-01-10T04:18:09.247Z warn: AI Response error for conversation b4e45862-ff99-4b16-adfe-a3e59d243b19 likely ca
used by Google censor/filter
2025-01-10T04:18:09.260Z debug: [AskController] Request closed
error log
{"level":"error","message":"[handleAbortError] AI response error; aborting request: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:streamGenerateContent?alt=sse: [400 Bad Request] Developer instruction is not enabled for models/gemini-1.5-flash","stack":"Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:streamGenerateContent?alt=sse: [400 Bad Request] Developer instruction is not enabled for models/gemini-1.5-flash\n at handleResponseNotOk (/app/node_modules/@google/generative-ai/dist/index.js:414:11)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async makeRequest (/app/node_modules/@google/generative-ai/dist/index.js:387:9)\n at async generateContentStream (/app/node_modules/@google/generative-ai/dist/index.js:827:22)\n at async GoogleClient.getCompletion (/app/api/app/clients/GoogleClient.js:702:22)\n at async GoogleClient.sendCompletion (/app/api/app/clients/GoogleClient.js:884:13)\n at async GoogleClient.sendMessage (/app/api/app/clients/BaseClient.js:577:24)\n at async AskController (/app/api/server/controllers/AskController.js:131:20)\n at async /app/api/server/routes/ask/google.js:23:5","status":400,"statusText":"Bad Request"} ScreenshotsNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Have you tried |
Beta Was this translation helpful? Give feedback.
-
Thanks for your comment. I don't know why I got an error the other day, but the problem is solved. |
Beta Was this translation helpful? Give feedback.
Thanks for your comment.
I checked the behavior with gemini-1.5-flash-latest.
As a result, it worked with both gemini-1.5-flash and gemini-1.5-flash-latest settings.
I don't know why I got an error the other day, but the problem is solved.