-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
✨ feat: add custom stream handle support for LobeOpenAICompatibleFactory #5039
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 #5039 +/- ##
==========================================
- Coverage 92.20% 92.16% -0.05%
==========================================
Files 568 569 +1
Lines 43395 43463 +68
Branches 2706 3890 +1184
==========================================
+ Hits 40012 40056 +44
- Misses 3383 3407 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…patibleFactory, custom stream handle
…transform handle
…able_search` for Qwen LLM
@arvinxx 改造好了
|
@arvinxx has been transformed
|
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.42.0](v1.41.0...v1.42.0) <sup>Released on **2024-12-29**</sup> #### ✨ Features - **misc**: Add custom stream handle support for LobeOpenAICompatibleFactory. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add custom stream handle support for LobeOpenAICompatibleFactory, closes [#5039](#5039) ([ea7e732](ea7e732)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 1.42.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.84.0](v1.83.0...v1.84.0) <sup>Released on **2024-12-29**</sup> #### ✨ Features - **misc**: Add custom stream handle support for LobeOpenAICompatibleFactory. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add custom stream handle support for LobeOpenAICompatibleFactory, closes [lobehub#5039](https://github.com/bentwnghk/lobe-chat/issues/5039) ([ea7e732](ea7e732)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
handleStream
及handleTransformResponseToStream
接口,用于应用自定义流处理a. 对语言模型默认启用内置联网搜索能力,引入
enable_search
(印象里之前有个 Issue 提了这个 feat,过会儿翻下) [Request] 增加通义千问打开联网搜索的开关 #4877b. 对
frequency_penalty
presence_penalty
temperature
top_p
进行范围限制- ref: https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-plus-api
- ref: https://help.aliyun.com/zh/dashscope/developer-reference/qwen-api
a. 通过改造实现了 Spark 的 Function Call 功能(整体工具调用效果不是特别好,存在限制)
b. 支持流式及非流式对话
c. 试了下工具调用支持流式,但是除了
max-32k
模型支持工具回调外,其余均不支持(curl
调用测试也为空;max-32k
存在相同 payload,上一秒还能出内容,再次执行直接返回空的问题)transformSparkStream
transformSparkResponseToStream
Spark 的工具调用流很怪,返回的是对象不是数组,通过魔改 OpenAI 流处理对非标准返回强制转换为数组
PS: 给讯飞开了工单,将近三个多月无进展
📝 补充信息 | Additional Information
非流式响应流
流式输出响应流