Commit e9aa8f0
committed
feat: Disable safety filters by default and add --safety flag
The default safety settings of the Gemini API can be restrictive for certain queries, occasionally blocking responses that are not harmful.
This commit disables content safety filters by default to provide a less restrictive user experience out-of-the-box. This is achieved by setting the `threshold` to `BLOCK_NONE` for harassment, hate speech, sexually explicit, and dangerous content categories.
A new `--safety` command-line flag is introduced to allow users to re-enable the API's default safety mechanisms if they prefer. When the `--safety` flag is used, the custom safety settings are omitted from the request, and the API's standard filtering is applied.1 parent 8bd7336 commit e9aa8f0
2 files changed
Lines changed: 44 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
1 | 9 | | |
2 | 10 | | |
3 | 11 | | |
| |||
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
292 | | - | |
| 300 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
2643 | 2644 | | |
2644 | 2645 | | |
2645 | 2646 | | |
2646 | | - | |
| 2647 | + | |
2647 | 2648 | | |
2648 | 2649 | | |
2649 | 2650 | | |
| |||
2670 | 2671 | | |
2671 | 2672 | | |
2672 | 2673 | | |
| 2674 | + | |
2673 | 2675 | | |
2674 | 2676 | | |
2675 | 2677 | | |
| |||
2804 | 2806 | | |
2805 | 2807 | | |
2806 | 2808 | | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
2807 | 2813 | | |
2808 | 2814 | | |
2809 | 2815 | | |
| |||
3047 | 3053 | | |
3048 | 3054 | | |
3049 | 3055 | | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
3050 | 3059 | | |
3051 | 3060 | | |
3052 | 3061 | | |
| |||
3627 | 3636 | | |
3628 | 3637 | | |
3629 | 3638 | | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
3630 | 3664 | | |
3631 | 3665 | | |
3632 | 3666 | | |
| |||
0 commit comments