-
-
Notifications
You must be signed in to change notification settings - Fork 14k
💄 style: support web_search tool for MiniMax & Zhipu
#7980
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
Conversation
|
@hezhijie0327 is attempting to deploy a commit to the LobeHub Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for raising your pull request and contributing to our Community |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7980 +/- ##
==========================================
- Coverage 88.36% 88.27% -0.09%
==========================================
Files 825 825
Lines 60553 60674 +121
Branches 5506 5514 +8
==========================================
+ Hits 53509 53562 +53
- Misses 7044 7112 +68
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
web_search tool for MiniMax & Zhipu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added web search functionality to MiniMax and Zhipu AI providers, with support for citation parsing and search engine configuration.
- Added
web_searchtool support insrc/libs/model-runtime/minimax/index.tswith citation handling for first tools response and final message annotations - Implemented Zhipu search configuration in
src/libs/model-runtime/zhipu/index.tswith customizable search engines viaZHIPU_SEARCH_ENGINEenvironment variable - Enhanced citation parsing in
src/libs/model-runtime/utils/streams/openai.tsto handle empty links and provider-specific formats - Added search capabilities to MiniMax models (MiniMax-Text-01 and abab6.5s-chat) in model configuration
💡 (4/5) You can add custom instructions or style guidelines for the bot here!
4 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
| if ((item as any).messages && (item as any).messages.length > 0) { | ||
| const citations = (item as any).messages.at(-1).annotations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Potential null reference error if annotations is undefined in the last message
| if ((item as any).messages && (item as any).messages.length > 0) { | |
| const citations = (item as any).messages.at(-1).annotations; | |
| if ((item as any).messages && (item as any).messages.length > 0) { | |
| const lastMessage = (item as any).messages.at(-1); | |
| const citations = lastMessage?.annotations; | |
| if (!citations) return []; |
| title: item.url, | ||
| url: item.url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Using URL as both title and URL may be confusing for users - consider using item.text for title
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
❤️ 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. |
### [Version 1.90.2](v1.90.1...v1.90.2) <sup>Released on **2025-06-01**</sup> #### 💄 Styles - **misc**: Support `web_search` tool for MiniMax & Zhipu. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Support `web_search` tool for MiniMax & Zhipu, closes [#7980](#7980) ([28cdafb](28cdafb)) </details> <div align="right"> [](#readme-top) </div>
|
🎉 This PR is included in version 1.90.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.88.0](v1.87.2...v1.88.0) <sup>Released on **2025-06-02**</sup> #### ✨ Features - **misc**: Support ModelScope Provider, support protect page. #### 🐛 Bug Fixes - **misc**: Agent automatic completion meta not working error, disable LaTeX and Mermaid rendering in SystemRoleContent to prevent lag caused by massive rendering tasks when switching topics, fix DeepSeek new R1 Search error. #### 💄 Styles - **misc**: `+` in the welcome message can be clicked to create an assistant, Enable deploymentName for Aliyun Bailian, Enhanced reasoning_effort Slider Component, support `web_search` tool for MiniMax & Zhipu, support 01.ai proxy url, Update Hunyuan models & deepseek-r1-0528, use default deployment name when parseModelString doesn't contain deployment name. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Support ModelScope Provider, closes [lobehub#8026](https://github.com/jaworldwideorg/OneJA-Bot/issues/8026) ([7b91dfd](7b91dfd)) * **misc**: Support protect page, closes [lobehub#8024](https://github.com/jaworldwideorg/OneJA-Bot/issues/8024) ([d61a9f5](d61a9f5)) #### What's fixed * **misc**: Agent automatic completion meta not working error, closes [lobehub#8003](https://github.com/jaworldwideorg/OneJA-Bot/issues/8003) ([c5307bf](c5307bf)) * **misc**: Disable LaTeX and Mermaid rendering in SystemRoleContent to prevent lag caused by massive rendering tasks when switching topics, closes [lobehub#8034](https://github.com/jaworldwideorg/OneJA-Bot/issues/8034) ([5b42ee2](5b42ee2)) * **misc**: Fix DeepSeek new R1 Search error, closes [lobehub#8035](https://github.com/jaworldwideorg/OneJA-Bot/issues/8035) ([cf58628](cf58628)) #### Styles * **misc**: `+` in the welcome message can be clicked to create an assistant, closes [lobehub#7984](https://github.com/jaworldwideorg/OneJA-Bot/issues/7984) ([9f07e4c](9f07e4c)) * **misc**: Enable deploymentName for Aliyun Bailian, closes [lobehub#7576](https://github.com/jaworldwideorg/OneJA-Bot/issues/7576) ([169e598](169e598)) * **misc**: Enhanced reasoning_effort Slider Component, closes [lobehub#7998](https://github.com/jaworldwideorg/OneJA-Bot/issues/7998) ([750b26a](750b26a)) * **misc**: Support `web_search` tool for MiniMax & Zhipu, closes [lobehub#7980](https://github.com/jaworldwideorg/OneJA-Bot/issues/7980) ([28cdafb](28cdafb)) * **misc**: Support 01.ai proxy url, closes [lobehub#8025](https://github.com/jaworldwideorg/OneJA-Bot/issues/8025) ([e0442b8](e0442b8)) * **misc**: Update Hunyuan models & deepseek-r1-0528, closes [lobehub#7993](https://github.com/jaworldwideorg/OneJA-Bot/issues/7993) ([2eb198c](2eb198c)) * **misc**: Use default deployment name when parseModelString doesn't contain deployment name, closes [lobehub#7719](https://github.com/jaworldwideorg/OneJA-Bot/issues/7719) ([aef19f4](aef19f4)) </details> <div align="right"> [](#readme-top) </div>
* 💄 style: support web_search for MiniMax * ♻️ refactor: refactor zhipu `web_search` tools * 🐛 fix: fix live search citations * ♻️ refactor: refactor Minimax citations * 🐛 fix: fix ci error * 🐛 fix: fix ci error * 💄 style: support OpenAI Search model citations --------- Co-authored-by: Arvin Xu <[email protected]>
### [Version 1.90.2](lobehub/lobe-chat@v1.90.1...v1.90.2) <sup>Released on **2025-06-01**</sup> #### 💄 Styles - **misc**: Support `web_search` tool for MiniMax & Zhipu. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Support `web_search` tool for MiniMax & Zhipu, closes [lobehub#7980](lobehub#7980) ([28cdafb](lobehub@28cdafb)) </details> <div align="right"> [](#readme-top) </div>
* 💄 style: support web_search for MiniMax * ♻️ refactor: refactor zhipu `web_search` tools * 🐛 fix: fix live search citations * ♻️ refactor: refactor Minimax citations * 🐛 fix: fix ci error * 🐛 fix: fix ci error * 💄 style: support OpenAI Search model citations --------- Co-authored-by: Arvin Xu <[email protected]>
### [Version 1.90.2](lobehub/lobe-chat@v1.90.1...v1.90.2) <sup>Released on **2025-06-01**</sup> #### 💄 Styles - **misc**: Support `web_search` tool for MiniMax & Zhipu. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Support `web_search` tool for MiniMax & Zhipu, closes [lobehub#7980](lobehub#7980) ([28cdafb](lobehub@28cdafb)) </details> <div align="right"> [](#readme-top) </div>
* 💄 style: support web_search for MiniMax * ♻️ refactor: refactor zhipu `web_search` tools * 🐛 fix: fix live search citations * ♻️ refactor: refactor Minimax citations * 🐛 fix: fix ci error * 🐛 fix: fix ci error * 💄 style: support OpenAI Search model citations --------- Co-authored-by: Arvin Xu <[email protected]>
### [Version 1.90.2](lobehub/lobe-chat@v1.90.1...v1.90.2) <sup>Released on **2025-06-01**</sup> #### 💄 Styles - **misc**: Support `web_search` tool for MiniMax & Zhipu. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Support `web_search` tool for MiniMax & Zhipu, closes [lobehub#7980](lobehub#7980) ([2f12db8](lobehub@2f12db8)) </details> <div align="right"> [](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
web_search工具的支持及引用源解析web_search工具的支持及引用源解析,引入ZHIPU_SEARCH_ENGINE变量(默认:search_std;可选:search_pro,search_pro_sogou,search_pro_quark,search_pro_jina,search_pro_bing)OPENAI_SEARCH_CONTEXT_SIZE变量(默认不引入;可选:low,medium,high)Note:
tools响应中返回content需要屏蔽;在最后一个流中messages的最后一个 Object 中返回annotationslink为空的情况导致崩溃📝 补充信息 | Additional Information
ref: https://platform.minimaxi.com/document/ChatCompletion%20v2?key=66701d281d57f38758d581d0#QklxsNSbaf6kM4j6wjO5eEek
ref: https://bigmodel.cn/dev/api/search-tool/websearch-in-chat
ref: https://platform.openai.com/docs/guides/tools-web-search