genkit icon indicating copy to clipboard operation
genkit copied to clipboard

[JS] Unhelpful error from imagen models in vertexai plugin

Open maxl0rd opened this issue 1 year ago • 2 comments

When imagen model fails to generate any predictions, the error is obscure instead of throwing a reasonable exception.

TypeError: Cannot read properties of undefined (reading 'map')
    at /workspace/node_modules/@genkit-ai/vertexai/lib/imagen.js:249:47

Expected behavior A clear and concise description of what you expected to happen.

As for Gemini models

throw new Error('No valid candidates returned.')

maxl0rd avatar Dec 02 '24 20:12 maxl0rd

Streaming the image result largely resolved this issue for me.

devchas avatar Feb 15 '25 00:02 devchas

@devchas can you share an example of your workaround?

damsorian avatar Apr 03 '25 00:04 damsorian