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

♻️ refactor: refactor Wenxin with LobeOpenAICompatibleFactory #5729

Merged
merged 6 commits into from
Feb 5, 2025

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Feb 4, 2025

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

  1. Wenxin 切回 LobeOpenAICompatibleFactory,使用 v2 接口(https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Fm2vrveyu#%E5%9C%A8%E7%BA%BF%E8%B0%83%E8%AF%95)
  2. 修复 v2 接口下模型 ID 问题(模型 ID 均为小写)
  3. 启用客户端请求模式
  4. 更新文档 [TODO]
  5. 更新模型列表 [TODO]

Note:

  1. 部分工具调用存在兼容性问题(不支持函数名包含 -,如 realtime-weather____fetchCurrentWeather
  2. deepseek-v3, deepseek-r1 限时免费
    image

📝 补充信息 | Additional Information

功能 截图
对话 image
工具调用 image
客户端请求 image

API Key 获取方法:
https://console.bce.baidu.com/iam/#/iam/apikey/list
image


close #5720

Copy link

vercel bot commented Feb 4, 2025

@hezhijie0327 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:XL This PR changes 500-999 lines, ignoring generated files. label Feb 4, 2025
@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
Contributor

gru-agent bot commented Feb 4, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 0c06212 ✅ Finished

Files

File Pull Request
src/config/llm.ts 🟢 Open #5734
src/services/_auth.ts 🔴 Closed #5735
src/store/user/slices/modelList/selectors/keyVaults.ts 🟢 Open #5733

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 98.77551% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.30%. Comparing base (3499403) to head (4c03422).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
src/libs/agent-runtime/AgentRuntime.ts 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5729      +/-   ##
==========================================
+ Coverage   92.11%   92.30%   +0.18%     
==========================================
  Files         648      646       -2     
  Lines       58199    58202       +3     
  Branches     2913     2712     -201     
==========================================
+ Hits        53612    53723     +111     
+ Misses       4587     4479     -108     
Flag Coverage Δ
app 92.30% <98.77%> (+0.18%) ⬆️
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:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Feb 4, 2025
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.

百度也归降了,可喜可贺 😄

Copy link

vercel bot commented Feb 5, 2025

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 Feb 5, 2025 5:24pm

@arvinxx arvinxx merged commit a90a75e into lobehub:main Feb 5, 2025
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 Feb 5, 2025
### [Version&nbsp;1.51.3](v1.51.2...v1.51.3)
<sup>Released on **2025-02-05**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory.

#### 🐛 Bug Fixes

- **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash.

#### 💄 Styles

- **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel.

<br/>

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

#### Code refactoring

* **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory, closes [#5729](#5729) ([a90a75e](a90a75e))

#### What's fixed

* **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash, closes [#5633](#5633) ([7d782b1](7d782b1))

#### Styles

* **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel, closes [#5764](#5764) ([db4e9c7](db4e9c7))

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

The release is available on:

Your semantic-release bot 📦🚀

@hezhijie0327 hezhijie0327 deleted the wenxin branch February 5, 2025 22:04
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Feb 6, 2025
### [Version&nbsp;1.93.2](v1.93.1...v1.93.2)
<sup>Released on **2025-02-06**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory.

#### 🐛 Bug Fixes

- **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash.

#### 💄 Styles

- **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel, update model list, add reasoning tag.

<br/>

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

#### Code refactoring

* **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory, closes [lobehub#5729](https://github.com/bentwnghk/lobe-chat/issues/5729) ([a90a75e](a90a75e))

#### What's fixed

* **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash, closes [lobehub#5633](https://github.com/bentwnghk/lobe-chat/issues/5633) ([7d782b1](7d782b1))

#### Styles

* **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel, closes [lobehub#5764](https://github.com/bentwnghk/lobe-chat/issues/5764) ([db4e9c7](db4e9c7))
* **misc**: Update model list, add reasoning tag, closes [lobehub#5696](https://github.com/bentwnghk/lobe-chat/issues/5696) ([dedd784](dedd784))

</details>

<div align="right">

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

</div>
Copy link

@Chris8813 Chris8813 left a comment

Choose a reason for hiding this comment

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

Boo

@LovelyGuYiMeng
Copy link
Contributor

今天使用文心的时候发现,原默认开启的网络搜索,在OpenAI兼容格式下并不会自动启用,希望能像Qwen一样通过环境变量启用网络搜索。
f4e7a01c0b70ab9c5a5781bd65a837ae

@lobehubbot
Copy link
Member

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


When I was using Wenxin today, I found that the original default-enabled network search will not be automatically enabled in OpenAI compatible format. I hope to enable network search through environment variables like Qwen.
f4e7a01c0b70ab9c5a5781bd65a837ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] 百度千帆模型不支持 deepseek-r1、deepseek-v3
5 participants