-
Notifications
You must be signed in to change notification settings - Fork 3k
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
assistant: Fix safety settings for google_ai #20178
base: main
Are you sure you want to change the base?
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @FedorBuben on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
safety_settings: None, | ||
safety_settings: Some(vec![google_ai::SafetySetting { | ||
category: google_ai::HarmCategory::DangerousContent, | ||
threshold: google_ai::HarmBlockThreshold::BlockNone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking any dangerous content seems like the wrong choice for a default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be an option for adjusting the filter settings?
HarmCategory::DangerousContent
is one of the 5 categories. The filter currently blocks content in all other categories.
From Gemini API Docs:
The Gemini API's adjustable safety filters cover the following categories:
Category | Description |
---|---|
Harassment | Negative or harmful comments targeting identity and/or protected attributes. |
Hate speech | Content that is rude, disrespectful, or profane. |
Sexually explicit | Contains references to sexual acts or other lewd content. |
Dangerous | Promotes, facilitates, or encourages harmful acts. |
Civic integrity | Election-related queries. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
Sometimes Gemini API's safety filter blocks code, considering it dangerous content. This happens quite often. The bug has been described in some comments under #18561. Here is an example prompt for Gemini Flash.
In Zed:
In Google AI Studio:
Disabling the
DangerousContent
category for the filter solves the problemRelease Notes: