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

🐛 fix: support Gemini 2.0 HarmBlockThreshold #5422

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Conversation

sxjeru
Copy link
Contributor

@sxjeru sxjeru commented Jan 13, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

根据官方论坛,gemini-2.0-flash 已不再响应 BLOCK_NONE ,而是暂时替换为 OFF

由测试可见,遇到安全风险时,模型会直接截断输出。

image

📝 补充信息 | Additional Information

这是更改后的效果。

image

Copy link

vercel bot commented Jan 13, 2025

@sxjeru is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 13, 2025
@lobehubbot
Copy link
Member

👍 @sxjeru

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added the 🐛 Bug Something isn't working | 缺陷 label Jan 13, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.10%. Comparing base (4d08343) to head (37d4916).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5422   +/-   ##
=======================================
  Coverage   93.10%   93.10%           
=======================================
  Files         631      631           
  Lines       55405    55406    +1     
  Branches     4242     4245    +3     
=======================================
+ Hits        51585    51586    +1     
  Misses       3820     3820           
Flag Coverage Δ
app 93.10% <100.00%> (+<0.01%) ⬆️
server 97.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arvinxx arvinxx merged commit 4d1a4cd into lobehub:main Jan 14, 2025
5 of 7 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @sxjeru ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

@sxjeru sxjeru deleted the patch-2 branch January 14, 2025 14:54
github-actions bot pushed a commit that referenced this pull request Jan 14, 2025
### [Version&nbsp;1.45.11](v1.45.10...v1.45.11)
<sup>Released on **2025-01-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Support Gemini 2.0 HarmBlockThreshold.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Support Gemini 2.0 HarmBlockThreshold, closes [#5422](#5422) ([4d1a4cd](4d1a4cd))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.45.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jan 14, 2025
### [Version&nbsp;1.87.7](v1.87.6...v1.87.7)
<sup>Released on **2025-01-14**</sup>

#### ♻ Code Refactoring

- **plugin**: Update plugin prompt.
- **misc**: Improve ai provider code.

#### 🐛 Bug Fixes

- **misc**: Fix `enable_search` parameter intro condition in Qwen, fix pull models error in new ai provider, fix some providers  issues, support Gemini 2.0 HarmBlockThreshold.

#### 💄 Styles

- **misc**: Improve model config form modal.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

* **plugin**: Update plugin prompt, closes [lobehub#5083](https://github.com/bentwnghk/lobe-chat/issues/5083) ([ddd3b53](ddd3b53))
* **misc**: Improve ai provider code, closes [lobehub#5442](https://github.com/bentwnghk/lobe-chat/issues/5442) ([32013b4](32013b4))

#### What's fixed

* **misc**: Fix `enable_search` parameter intro condition in Qwen, closes [lobehub#5297](https://github.com/bentwnghk/lobe-chat/issues/5297) ([0b19c20](0b19c20))
* **misc**: Fix pull models error in new ai provider, closes [lobehub#5441](https://github.com/bentwnghk/lobe-chat/issues/5441) ([1726d85](1726d85))
* **misc**: Fix some providers  issues, closes [lobehub#5429](https://github.com/bentwnghk/lobe-chat/issues/5429) ([b7edbd3](b7edbd3))
* **misc**: Support Gemini 2.0 HarmBlockThreshold, closes [lobehub#5422](https://github.com/bentwnghk/lobe-chat/issues/5422) ([4d1a4cd](4d1a4cd))

#### Styles

* **misc**: Improve model config form modal, closes [lobehub#5438](https://github.com/bentwnghk/lobe-chat/issues/5438) ([9b303e0](9b303e0))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@sxjeru sxjeru restored the patch-2 branch January 15, 2025 05:55
@sxjeru sxjeru deleted the patch-2 branch January 15, 2025 05:59
@dupl
Copy link
Contributor

dupl commented Jan 16, 2025

这个提交之后,vercel和netlify部署的 gemini-2.0-flash-thinking-exp-1219 模型,不能正常使用了。比如问一下“天空为什么是蓝色的”,回复只有一个单词,如“Thing”、“We”、“Let”,或者回复空白,部署提交之前的版本就正常。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


After this submission, the gemini-2.0-flash-thinking-exp-1219 model deployed by vercel and netlify cannot be used normally. For example, if you ask "Why is the sky blue?" and the reply is only one word, such as "Thing", "We", "Let", or the reply is blank, the deployment of the version before submission will be normal.

gecsp pushed a commit to gecsp/lobe-chat that referenced this pull request Jan 22, 2025
gecsp pushed a commit to gecsp/lobe-chat that referenced this pull request Jan 22, 2025
### [Version&nbsp;1.45.11](lobehub/lobe-chat@v1.45.10...v1.45.11)
<sup>Released on **2025-01-14**</sup>

#### 🐛 Bug Fixes

- **misc**: Support Gemini 2.0 HarmBlockThreshold.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Support Gemini 2.0 HarmBlockThreshold, closes [lobehub#5422](lobehub#5422) ([4d1a4cd](lobehub@4d1a4cd))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 released size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants