Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocked image generation should throw #321

Open
mbleigh opened this issue Mar 18, 2025 · 0 comments
Open

Blocked image generation should throw #321

mbleigh opened this issue Mar 18, 2025 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@mbleigh
Copy link

mbleigh commented Mar 18, 2025

Right now depending on the type of image generation block it will either throw or return a response without an image. There seems to be a pre-filter that throws, giving an error like:

400 Bad Request. {"error":{"code":400,"message":"Image generation failed with the following error: The prompt could not be submitted. This prompt contains sensitive words that violate Google's Responsible AI practices.

But there's a separate failure condition that does not throw but returns a response like:

{
  generatedImages: [
    {
      image: {},
      raiFilteredReason: "Unable to show generated images. All images were filtered out because they violated Vertex AI's usage guidelines. You will not be charged for blocked images. Try rephrasing the prompt. If you think this was an error, send feedback. Support codes: 29310472",
      safetyAttributes: {}
    }
  ]
}

I believe the latter should throw with the raiFilteredReason included in the error message. If the generation does not return any images, it is an error.

@mbleigh mbleigh added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant