Hi, I am trying to list the files for my Gemini client using the code below:
client = genai.Client(api_key=API_KEYS.get(api_type))
print(client.files.list())
but the print(client.files.list())
throws the below error. I need to list the files to use the API, as I have reached my quota limit for file storage (20GB) and need to delete some files. I have been doing it for a couple of days, and it was working fine, but then it went awry last night.
File "/root/home/molmo-R1/molmo_r1/context_vlm.py", line 35, in __init__
print(self.client.files.list())
^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.conda/envs/prog-r1/lib/python3.11/site-packages/google/genai/files.py", line 714, in list
self._list(config=config),
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.conda/envs/prog-r1/lib/python3.11/site-packages/google/genai/files.py", line 385, in _list
response_dict = self._api_client.request(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.conda/envs/prog-r1/lib/python3.11/site-packages/google/genai/_api_client.py", line 755, in request
response = self._request(http_request, stream=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.conda/envs/prog-r1/lib/python3.11/site-packages/google/genai/_api_client.py", line 684, in _request
errors.APIError.raise_for_response(response)
File "/root/.conda/envs/prog-r1/lib/python3.11/site-packages/google/genai/errors.py", line 103, in raise_for_response
raise ServerError(status_code, response_json, response)
google.genai.errors.ServerError: 500 INTERNAL. {'error': {'code': 500, 'message': 'Failed to convert server response to JSON', 'status': 'INTERNAL'}}