[JS] Unhelpful error from imagen models ...
I would like to send requests to the Imagen API with the includeRaiReason field set to true by default.
When images are not generated due to Gemini's AI filter, response.predictions becomes undefined.
This reproduces the issue mentioned in https://github.com/firebase/genkit/issues/1446 (as undefined.map cannot be executed).
I also believe, as stated in the issue, that cases where generation fails should be included in the error response.
However, simply fixing the .map method will not solve this problem. To obtain the reason for the failure to generate images, adding the includeRaiReason field to the request is necessary.
If this suggestion is acceptable, I would like to try implementing it myself. What do you think about this proposal?
When fixed, a message like the one shown in the attached image will appear.
