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

feat: able to change gemini safety setting #867

Merged

Conversation

tisfeng
Copy link
Contributor

@tisfeng tisfeng commented Dec 24, 2023

close #831
close #866

我已确认该 PR 已自测通过,相关截图如下:

image

@tisfeng
Copy link
Contributor Author

tisfeng commented Dec 24, 2023

Gemini 的安全策略太严格了,翻译测试时,很多句子都会被审查拦截,这都是一些完全没有必要的安全审查。

OpenAI 接口没有安全设置项,因此 Gemini 直接设置了 BLOCK_NONE。

我们不必担心真正的安全问题,即使设置 BLOCK_NONE,Gemini 内部还是会有一道核心安全审查。

https://ai.google.dev/docs/safety_setting_gemini?hl=zh-cn#safety-filters

除了可调整的安全过滤器之外,Gemini API 还内置了防范核心危害(例如危及儿童安全的内容)。这些类型的危害始终会遭到阻止且无法调整。

可调节的安全过滤器涵盖以下类别:

骚扰内容
仇恨言论
露骨色情
危险内容

image

@tisfeng
Copy link
Contributor Author

tisfeng commented Jan 1, 2024

PR 有什么问题吗,来个人推进处理一下 🙂

@songquanpeng
Copy link
Owner

我修改了一些,改成了环境变量设置,默认 BLOCK_NONE

@songquanpeng
Copy link
Owner

PR 有什么问题吗,来个人推进处理一下 🙂

只有周末有空哈

@tisfeng
Copy link
Contributor Author

tisfeng commented Jan 1, 2024

ok

@songquanpeng songquanpeng changed the title perf: adjust gemini safety settings, set BLOCK_NONE by default feat: able to change gemini safety setting Jan 1, 2024
@songquanpeng songquanpeng merged commit af8908d into songquanpeng:main Jan 1, 2024
@tisfeng tisfeng deleted the adjust-gemini-safety-settings branch January 1, 2024 13:49
greeeds pushed a commit to greeeds/one-api that referenced this pull request Mar 3, 2024
* perf: adjust gemini safety settings, set BLOCK_NONE by default

* feat: able to adjust by env variable

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants