I am getting the same error for one particular cloud console project.
Tried a different project and it worked fine.
The message from the @google-genai library is error incredibly unhelpful.
I stepped through with a debugger and was so surprised list files was the issue.
: (in promise) ApiError: {“error”:{“code”:500,“message”:“Failed to convert server response to JSON”,“status”:“INTERNAL”}}
\* The harm category is hate speech.
REST API version:
{
"error": {
"code": 500,
"message": "Failed to convert server response to JSON",
"status": "INTERNAL"
}
}
Maybe due to interrupting an upload mid stream leaving the file server in a weird state?
The documentation on what happens behind the scenes is non-existent and the endpoint documentation also is lackluster.
The list files param pageSize gives no sense of what the max is for example.