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: Multiple deepseek-reasoner request errors #5601

Merged
merged 4 commits into from
Feb 1, 2025

Conversation

sxjeru
Copy link
Contributor

@sxjeru sxjeru commented Jan 26, 2025

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

替代 #5548

通过插入空消息,使消息格式符合 deepseek 要求,避免报错与损失信息。

📝 补充信息 | Additional Information

报错举例:

The first message (except the system message) of deepseek-reasoner must be a user message, 
but an assistant message detected.
deepseek-reasoner does not support successive user or assistant messages (messages[x] and messages[x] in your input). 
You should interleave the user/assistant messages in the message sequence.

fix #5620

Sorry, something went wrong.

Copy link

vercel bot commented Jan 26, 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:M This PR changes 30-99 lines, ignoring generated files. label Jan 26, 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 26, 2025
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.17%. Comparing base (deb03ad) to head (3cbcab9).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5601      +/-   ##
==========================================
+ Coverage   92.15%   92.17%   +0.01%     
==========================================
  Files         647      647              
  Lines       57487    57512      +25     
  Branches     4061     4068       +7     
==========================================
+ Hits        52978    53009      +31     
+ Misses       4509     4503       -6     
Flag Coverage Δ
app 92.17% <100.00%> (+0.01%) ⬆️
server 98.01% <ø> (ø)

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.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 27, 2025
@sxjeru sxjeru requested a review from arvinxx January 27, 2025 09:43
Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 pair 逻辑之前 claude 和 google 都需要,感觉后续可以统一成一个公共方法给出来?

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-preview 🛑 Canceled (Inspect) Feb 1, 2025 3:14pm

@sxjeru
Copy link
Contributor Author

sxjeru commented Jan 29, 2025

这个 pair 逻辑之前 claude 和 google 都需要,感觉后续可以统一成一个公共方法给出来?

可以的,不过咱不了解 lobechat 的架构,希望能详细说下具体要放在哪个文件,如何从外部引用等。

@lobehubbot
Copy link
Member

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


Claude and Google are needed before this Pair logic. It feels that it can be unified into a public method in the future?

Yes, but we don't understand the structure of Lobechat, I hope to explain in detail which file to be placed, how to reference from external references, etc.

@arvinxx arvinxx merged commit 71cc32b into lobehub:main Feb 1, 2025
6 of 8 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 消息。

@vercel vercel bot temporarily deployed to Preview – lobe-chat-preview February 1, 2025 15:14 Inactive
github-actions bot pushed a commit that referenced this pull request Feb 1, 2025
### [Version&nbsp;1.49.7](v1.49.6...v1.49.7)
<sup>Released on **2025-02-01**</sup>

#### 🐛 Bug Fixes

- **misc**: Multiple deepseek-reasoner request errors.

<br/>

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

#### What's fixed

* **misc**: Multiple deepseek-reasoner request errors, closes [#5601](#5601) ([71cc32b](71cc32b))

</details>

<div align="right">

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

</div>
@arvinxx
Copy link
Contributor

arvinxx commented Feb 1, 2025

不过咱不了解 lobechat 的架构,希望能详细说下具体要放在哪个文件,如何从外部引用等。

可以,我后面写一个 RFC

@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.49.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lobehubbot
Copy link
Member

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


But we don't understand the structure of Lobechat, and hope to explain in detail which file to be placed, how to reference from external references, etc.

Yes, I write a RFC later

@sxjeru sxjeru deleted the fork126 branch February 1, 2025 15:46
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Feb 1, 2025
### [Version&nbsp;1.91.4](v1.91.3...v1.91.4)
<sup>Released on **2025-02-01**</sup>

#### 🐛 Bug Fixes

- **misc**: Multiple deepseek-reasoner request errors.

#### 💄 Styles

- **misc**: Support thinking for all non DeepSeek official api R1 models.

<br/>

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

#### What's fixed

* **misc**: Multiple deepseek-reasoner request errors, closes [lobehub#5601](https://github.com/bentwnghk/lobe-chat/issues/5601) ([71cc32b](71cc32b))

#### Styles

* **misc**: Support thinking for all non DeepSeek official api R1 models, closes [lobehub#5654](https://github.com/bentwnghk/lobe-chat/issues/5654) ([9b32137](9b32137))

</details>

<div align="right">

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

</div>
ramu-narasinga pushed a commit to ramu-narasinga/lobe-chat that referenced this pull request Feb 17, 2025
* Update index.ts

* Update index.ts

* Update index.test.ts
ramu-narasinga pushed a commit to ramu-narasinga/lobe-chat that referenced this pull request Feb 17, 2025
### [Version&nbsp;1.49.7](lobehub/lobe-chat@v1.49.6...v1.49.7)
<sup>Released on **2025-02-01**</sup>

#### 🐛 Bug Fixes

- **misc**: Multiple deepseek-reasoner request errors.

<br/>

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

#### What's fixed

* **misc**: Multiple deepseek-reasoner request errors, closes [lobehub#5601](lobehub#5601) ([71cc32b](lobehub@71cc32b))

</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:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Unable to engage in more than two rounds of conversation with Deepseeker R1
3 participants