Skip to content

💄 style: add SenseNova-V6 series & SenseChat-Vision support #7439

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

Merged
merged 13 commits into from
Apr 18, 2025

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Apr 16, 2025

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

  1. 增加 SenseNova-V6 系列
  2. 兼容 SenseNova-V6 系列 content 已支持文本对话及多模态对话
  3. 模型图标更新 💄 style: add SenseNova-V6 series icon support lobe-icons#100
  4. 得修个 CI error Move arrow function 'processContent' to the outer scope unicorn/consistent-function-scoping [TODO] 已修复,移动至 convertSenseNovaMessage
  5. 补个 convertSenseNovaMessage 单测 [TODO] 已补齐
  6. 适配 SenseChat-Vision 对话支持,同 SenseNova-V6 系列处理,同时支持 image_urlimage_base64 两种格式

Model Screenshot
SenseNova-V6 image
SenseChat-Vision image
SenseChat-5 image

📝 补充信息 | Additional Information

related: #7433


当前 OpenAI 兼容模式下 SenseNova-V6 系列及 SenseChat-Vision 的 content 部分存在结构兼容性问题,已反馈待解决

curl --location 'https://api.sensenova.cn/compatible-mode/v1/chat/completions' \
--header 'Authorization: Bearer your-api-key' \
--header 'Content-Type: application/json' \
--data '{
    "model": "SenseNova-V6-Pro",
    "messages": [
        {
            "content": "你是一个冷笑话生成器",
            "role": "system"
        },
        {
            "content": [
                {
                    "type": "text",
                    "text": "请讲一个冷笑话"
                }
            ],
            "role": "user"
        },
        {
            "content": "好的,这是一个冷笑话:\n\n有一天,一只北极熊和一只企鹅去酒吧喝酒。北极熊点了一杯冰镇啤酒,企鹅点了一杯温水。\n\n服务员问北极熊:“为什么你点的是冰镇啤酒?”\n\n北极熊回答说:“因为我要保持冷静。”\n\n服务员又问企鹅:“那你为什么点的是温水?”\n\n企鹅回答说:“因为我听说温水有助于消化。”\n\n服务员感到非常困惑,于是问:“你们是怎么知道这些的?”\n\n北极熊和企鹅异口同声地回答:“我们是在书上看到的!”",
            "role": "assistant"
        },
        {
            "content": [
                {
                    "text": "请再讲一个冷笑话",
                    "type": "text"
                }
            ],
            "role": "user"
        }
    ],
    "max_new_tokens": 1024,
    "repetition_penalty": 1.0,
    "stream": false,
    "temperature": 0.8,
    "top_p": 0.7
}'

Copy link

vercel bot commented Apr 16, 2025

@hezhijie0327 is attempting to deploy a commit to the LobeHub 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 Apr 16, 2025

Codecov Report

Attention: Patch coverage is 94.80519% with 8 lines in your changes missing coverage. Please review.

Project coverage is 89.58%. Comparing base (b6d2c31) to head (0a4ba0b).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/libs/agent-runtime/sensenova/index.ts 42.85% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7439      +/-   ##
==========================================
+ Coverage   89.49%   89.58%   +0.09%     
==========================================
  Files         760      761       +1     
  Lines       54191    54712     +521     
  Branches     3466     5076    +1610     
==========================================
+ Hits        48500    49016     +516     
- Misses       5691     5696       +5     
Flag Coverage Δ
app 89.58% <94.80%> (+0.09%) ⬆️
server 95.74% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hezhijie0327 hezhijie0327 marked this pull request as ready for review April 17, 2025 10:34
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 17, 2025
Copy link
Contributor

gru-agent bot commented Apr 17, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 8d33e48 🚫 Skipped No files need to be tested {"src/config/aiModels/sensenova.ts":"target file(src/config/aiModels/sensenova.ts) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/ \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,/*.spec.js,src/database/server","src/libs/agent-runtime/sensenova/index.ts":"target file(src/libs/agent-runtime/sensenova/index.ts) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/** \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,**/*.spec.js,src/database/server"}

Tip

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

@dosubot dosubot bot added the 💄 Design Design an style | 样式问题 label Apr 17, 2025
@hezhijie0327 hezhijie0327 marked this pull request as draft April 17, 2025 13:00
@hezhijie0327
Copy link
Contributor Author

感觉似乎可以顺带把 SenseChat-Vision 的图片输入给支持了,使用 convertSenseNovaMessage 中的 image_url 逻辑加个参数控制

@lobehubbot
Copy link
Member

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


It seems that you can support the image input of SenseChat-Vision, and use the image_url logic in convertSenseNovaMessage to add parameter control.

@hezhijie0327 hezhijie0327 changed the title 💄 style: add SenseNova-V6 series support 💄 style: add SenseNova-V6 series & SenseChat-Vision support Apr 17, 2025
@hezhijie0327 hezhijie0327 marked this pull request as ready for review April 17, 2025 14:10
Copy link
Contributor

gru-agent bot commented Apr 17, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 13b298e 🚫 Skipped No files need to be tested {"src/config/aiModels/sensenova.ts":"target file(src/config/aiModels/sensenova.ts) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/ \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,/*.spec.js,src/database/server","src/libs/agent-runtime/sensenova/index.ts":"target file(src/libs/agent-runtime/sensenova/index.ts) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/** \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,/*.spec.js,src/database/server","src/libs/agent-runtime/utils/sensenovaHelpers.test.ts":"target file(src/libs/agent-runtime/utils/sensenovaHelpers.test.ts) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/** \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,**/*.spec.t…

Tip

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

@hezhijie0327
Copy link
Contributor Author

可以了,原来之前 SenseChat-Vision 遇到的问题,和 v6 是一样的...

同时支持 image_urlimage_base64 两种格式

@lobehubbot
Copy link
Member

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


OK, it turns out that the problem encountered by SenseChat-Vision before is the same as v6...

Supports both image_url and image_base64 formats

Copy link

vercel bot commented Apr 17, 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 Apr 17, 2025 3:34pm

@arvinxx arvinxx merged commit 9c8597f into lobehub:main Apr 18, 2025
19 of 20 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 消息。

@hezhijie0327 hezhijie0327 deleted the sensenova branch April 18, 2025 01:58
github-actions bot pushed a commit that referenced this pull request Apr 18, 2025
### [Version&nbsp;1.81.1](v1.81.0...v1.81.1)
<sup>Released on **2025-04-18**</sup>

#### 💄 Styles

- **misc**: Add `SenseNova-V6` series & `SenseChat-Vision` support.

<br/>

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

#### Styles

* **misc**: Add `SenseNova-V6` series & `SenseChat-Vision` support, closes [#7439](#7439) ([9c8597f](9c8597f))

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

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Apr 18, 2025
## [Version&nbsp;1.120.0](v1.119.2...v1.120.0)
<sup>Released on **2025-04-18**</sup>

#### ✨ Features

- **misc**: Support search1api as search provider.

#### 💄 Styles

- **misc**: Add `SenseNova-V6` series & `SenseChat-Vision` support, Allow folding SystemRole box, update 360 AI & Taichu & AI21 model list.

<br/>

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

#### What's improved

* **misc**: Support search1api as search provider, closes [lobehub#7449](https://github.com/bentwnghk/lobe-chat/issues/7449) ([2738cac](2738cac))

#### Styles

* **misc**: Add `SenseNova-V6` series & `SenseChat-Vision` support, closes [lobehub#7439](https://github.com/bentwnghk/lobe-chat/issues/7439) ([9c8597f](9c8597f))
* **misc**: Allow folding SystemRole box, closes [lobehub#7421](https://github.com/bentwnghk/lobe-chat/issues/7421) ([c147df7](c147df7))
* **misc**: Update 360 AI & Taichu & AI21 model list, closes [lobehub#7443](https://github.com/bentwnghk/lobe-chat/issues/7443) ([60c9ae2](60c9ae2))

</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
💄 Design Design an style | 样式问题 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.

3 participants