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: fix fallback behavior of default mode in AgentRuntime #4813

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Nov 27, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

触发原因:
当时 Fallback 判定写的有问题,不应该用 APIKey 值是否存在作为判定依据,导致只要模型的 APIKey 环境变量为空,就走 OpenAI。也反向印证了昨天 Qwen 行为在设置 QWEN_API_KEY 后就正常

改进方法:
改为判定 *_API_KEY 是否在 llmConfig 中声明

close #4809

📝 补充信息 | Additional Information

测试场景:

环境变量 设置值
OPENAI_PROXY_URL https://proxy.example.org/v1
ANTHROPIC_API_KEY
Before After
image image

Copy link

vercel bot commented Nov 27, 2024

@hezhijie0327 is attempting to deploy a commit to the LobeChat Community Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @hezhijie0327

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.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.53%. Comparing base (3da1704) to head (a68c7b5).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #4813     +/-   ##
=========================================
  Coverage   91.53%   91.53%             
=========================================
  Files         538      538             
  Lines       37803    37803             
  Branches     3651     2478   -1173     
=========================================
  Hits        34603    34603             
  Misses       3200     3200             
Flag Coverage Δ
app 91.53% <100.00%> (ø)
server 96.21% <ø> (ø)

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.

@hezhijie0327 hezhijie0327 marked this pull request as ready for review November 27, 2024 11:40
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐛 Bug Something isn't working | 缺陷 labels Nov 27, 2024
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Nov 27, 2024
Copy link

vercel bot commented Nov 27, 2024

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

Name Status Preview Comments Updated (UTC)
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 4:04pm

@arvinxx arvinxx merged commit e7cb62e into lobehub:main Nov 27, 2024
7 of 8 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @hezhijie0327 ❤️

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 消息。

github-actions bot pushed a commit that referenced this pull request Nov 27, 2024
### [Version&nbsp;1.34.3](v1.34.2...v1.34.3)
<sup>Released on **2024-11-27**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix fallback behavior of default mode in AgentRuntime.

<br/>

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

#### What's fixed

* **misc**: Fix fallback behavior of default mode in AgentRuntime, closes [#4813](#4813) ([e7cb62e](e7cb62e))

</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.34.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@hezhijie0327 hezhijie0327 deleted the agentRuntime branch November 27, 2024 21:06
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Nov 28, 2024
### [Version&nbsp;1.76.2](v1.76.1...v1.76.2)
<sup>Released on **2024-11-28**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix fallback behavior of default mode in AgentRuntime.

#### 💄 Styles

- **misc**: Add switch portal thread.

<br/>

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

#### What's fixed

* **misc**: Fix fallback behavior of default mode in AgentRuntime, closes [lobehub#4813](https://github.com/bentwnghk/lobe-chat/issues/4813) ([e7cb62e](e7cb62e))

#### Styles

* **misc**: Add switch portal thread, closes [lobehub#4819](https://github.com/bentwnghk/lobe-chat/issues/4819) ([8dbf3ce](8dbf3ce))

</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:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Lobe language model runtime execution error with Qwen provider
3 participants