Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Internal error encountered on uploading audio file uri to gemini

Hello, im using google cloud to upload audio and then uploadind file to gemini 

 

request for uploading audio

"POST {} HTTP/1.1\r\nHost: generativelanguage.googleapis.com\r\n\
        Content-Length: {}\r\n\
        Content-Type: audio/mpeg\r\n\
        X-Goog-Upload-Offset: 0\r\n\
        X-Goog-Upload-Command: upload,finalize\r\n\r\n\
        {:?}"

 

POST /v1beta/models/gemini-1.5-pro:generateContent?key=key HTTP/1.1
Host: generativelanguage.googleapis.com
Content-Type: application/json
Content-Length: 262

{
      "contents": [{
        "parts":[
          {"text": "What is the current Google stock price?"},
          {"file_data":{"mime_type": "audio/mpeg", "file_uri": "https://generativelanguage.googleapis.com/v1beta/files/309oy4antidm" }}]
        }]
    }
output
6d

{
  "error": {
    "code": 500,
    "message": "Internal error encountered.",
    "status": "INTERNAL"
  }
}

0

 

 

   
0 1 209
1 REPLY 1

Hi @hashiramaSenjuh

Welcome to Google Cloud Community!

500 internal server error can be caused by various issues on the server side, such as server misconfigurations, scripting errors, or temporary server overloads.

In many cases, the issue can be resolved by the server administrator or may resolve itself over time. Please also try the following troubleshooting that may help to fix the issue:

  • Temporarily switch to another model such as gemini-1.5-flash and see if it works.
  • Double check your API key and refer to this guide on how to interact with audio files and audio content using the Gemini API.
  • Clear your web browser cookies and cache. Sometimes, the issue can be fixed by clearing your browser cache and cookies and restarting the browser. 
  • Try again later, as sometimes the issue can be resolved.
  • Inspect Cloud Logging to check for the logs and events under Logs Explorer for the summary of the issue.

I hope the above information is helpful.