Hello! Today, I’ve suddenly been having this error constantly, across Google Accounts and API keys when using the Gemini API through my Android app. It was working perfectly fine the last few days.
I’m using the free API, and I was planning to pay for it but I’m having second thoughts now.
Error: Unexpected Response:
"error": {
"code": 500,
"message": "An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting",
"status": "INTERNAL"
kotlinx. serialization. MissingFieldException: Field 'details' is required for type with serial name 'com.google.ai.client.generativeai.common.server. GRpcError', but it was missing at path: $.error
The following is my model initialisation code. Is it because I’m doing something wrong here?
Content systemInstructionsContent = new Content.Builder()
.addText(systemInstructions)
.build();
GenerativeModel gm = new GenerativeModel(
"gemini-1.5-pro",
apiKey,
null,
null,
new RequestOptions(), // Use default RequestOptions
null,
null,
systemInstructionsContent
);
I’m leaving some of the parameters as null, as I want them at the default and only want to add a system prompt.
I’m using Java to call the model from my Android app!
Thanks so so much for the help!