Since two days ago gemini-1.5-flash (both 01 and 02) throws a 500 error when audio is provided as input. I’ve tried with both inline audio and using the File API, both give the same (unhelpful) error below. Size of the audio file does not matter. We use exponential retry, and this does not help.
I should add that normal calls to gemini-1.5-flash (without audio) do work properly,
Because I make frequent use of audio, I’m 100% confident that this broke without any changes in the audio-files or code on our side. Something in the Gemini backend must have changed, as we also didn’t update the SDK version.
I am using the (recently deprecated) google-generativeai==0.8.4, don’t know if the new SDK solves the problem as that is a fairly significant refactor that I haven’t done yet.
The only fix that did work for me was to switch to the 2.0-flash and 2.0-flash-lite models. While it is a solution, it’s not great to be forced into it.
Exception: 500 Unable to submit request because the service is temporarily unavailable.,
Exception traceback: Traceback (most recent call last):
File "/opt/render/project/src/.venv/lib/python3.11/site-packages/tenacity/__init__.py", line 382, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/render/project/src/src/myrepo/llm_utils.py", line 177, in ask_gemini
response = model.generate_content(contents)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/render/project/src/.venv/lib/python3.11/site-packages/google/generativeai/generative_models.py", line 331, in generate_content
response = self._client.generate_content(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/render/project/src/.venv/lib/python3.11/site-packages/google/ai/generativelanguage_v1beta/services/generative_service/client.py", line 830, in generate_content
response = rpc(
^^^^```