Expected Behavior

It should be possible for each call (and globally) to define the desired safety settings for each harm category.

Current Behavior

Right now there is no way at all to configure these settings. The default settings (which I think are medium) are used. For many nonharmful use-cases Gemini refuses to generate a response.

Context

The Gemini API provides safety settings where you can configure the level at which certain harmful content (e.g., hate speech) should be blocked. Gemini seems to interpret what is harmful rather strictly, and even nonharmful content will be blocked when using the default settings. The protobuf model that Spring AI uses has fields to configure these settings, but unfortunately, there is no way to configure them in the Spring abstraction.

Comment From: ddobrin

The Gemini safety filters are being provided in detail here: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters

Assign this issue to me and I will look into it for the M4 milestone or next one