This is the final fix. I'm confident this will resolve all the errors.
[API Error: got status: INTERNAL. {"error":{"code":500,"message":"An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting..."}}]```