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

โœจ feat: add Hunyuan(Tencent) model provider #4147

Merged
merged 9 commits into from
Sep 27, 2024

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Sep 26, 2024

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • โœจ feat
  • ๐Ÿ› fix
  • โ™ป๏ธ refactor
  • ๐Ÿ’„ style
  • ๐Ÿ‘ท build
  • โšก๏ธ perf
  • ๐Ÿ“ docs
  • ๐Ÿ”จ chore

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

  1. ๆ›ดๆ–ฐ modelProvider ๅ›พๆ ‡ [TODO] ๐Ÿ’„ style: add Hunyuan provider iconย lobe-icons#42
  2. ๆทปๅŠ  HUNYUAN_MODEL_LIST ๆ”ฏๆŒ [TODO]
  3. ๆทปๅŠ ๆจกๅž‹ไปทๆ ผๅŠๆไพ›ๅ•†ๆ่ฟฐ
  4. ็ฆ็”จๅฎขๆˆท็ซฏๆจกๅผ๏ผŒไธๆ”ฏๆŒ

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

ๅฏน่ฏ
image
ๅทฅๅ…ท่ฐƒ็”จ
image
ๅคšๆจกๆ€
image

Copy link

vercel bot commented Sep 26, 2024

@hezhijie0327 is attempting to deploy a commit to the LobeHub Pro 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 Sep 26, 2024

Codecov Report

Attention: Patch coverage is 95.28796% with 9 lines in your changes missing coverage. Please review.

Project coverage is 92.49%. Comparing base (40d347f) to head (b11352f).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/app/api/chat/agentRuntime.ts 14.28% 6 Missing โš ๏ธ
src/libs/agent-runtime/AgentRuntime.ts 57.14% 3 Missing โš ๏ธ
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4147      +/-   ##
==========================================
+ Coverage   92.48%   92.49%   +0.01%     
==========================================
  Files         482      484       +2     
  Lines       34488    34679     +191     
  Branches     3231     3384     +153     
==========================================
+ Hits        31896    32078     +182     
- Misses       2592     2601       +9     
Flag Coverage ฮ”
app 92.49% <95.28%> (+0.01%) โฌ†๏ธ
server 97.36% <รธ> (รธ)

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 September 26, 2024 05:51
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. ๐ŸŒ  Feature Request New feature or request | ็‰นๆ€งไธŽๅปบ่ฎฎ labels Sep 26, 2024
@LovelyGuYiMeng
Copy link
Contributor

LovelyGuYiMeng commented Sep 26, 2024

providerๆŽ’ๅˆ—๏ผŒๆททๅ…ƒๆ”พๅˆฐ่ฎฏ้ฃžไธŠ้ขๅง๏ผŒๆˆ‘ๆ˜ฏๆ‰“็ฎ—ๅƒ้—ฎ๏ผŒ็™พๅบฆ๏ผŒๆททๅ…ƒ๏ผŒ่ฎฏ้ฃž่ฟ™ๅ››ไธชๆŽ’ๅ‰้ข็š„
ๅฆๅค–่ฟ™ไธชไธŠไธ‹ๆ–‡ๅฏนๅ˜›๏ผŒๆˆ‘็œ‹ๆณจ้‡Šไธญๅ†™ไบ†Codeๆจกๅž‹ไธŠไธ‹ๆ–‡้•ฟๅบฆๅขž้•ฟๅˆฐ8k๏ผŒๅฏๆ˜ฏtoken่ฟ˜ๆ˜ฏ4000
็„ถๅŽ่ฟ˜ๆœ‰FunctionCall็š„32k๏ผŒ็œŸๆ˜ฏ28_000ๅ˜›๏ผŸ
256k่ฎพ็ฝฎ้ป˜่ฎคenabledๅง

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


In terms of provider arrangement, put Hunyuan on top of iFlytek. I plan to place Qianwen, Baidu, Hunyuan, and iFlytek at the top of the list.
Also, is this context correct? I saw in the comments that the Code model context length has increased to 8k, but the token is still 4000.
Then there is FunctionCallโ€™s 32k, how can it be 28_000?

@hezhijie0327
Copy link
Contributor Author

emmmmmm ็œ‹ไธ‹ไปฃ็ ๆณจ้‡Š https://cloud.tencent.com/document/product/1729/104753

image

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


emmmmmmm Take a look at the code comments https://cloud.tencent.com/document/product/1729/104753

image

@LovelyGuYiMeng
Copy link
Contributor

LovelyGuYiMeng commented Sep 26, 2024

image
ๆ€Žไนˆ่ฏดๅ‘ข๏ผŒๆ นๆฎๅƒ้—ฎๆจกๅž‹ๆฅ็œ‹็š„่ฏ๏ผŒไธŠไธ‹ๆ–‡้•ฟๅบฆๅบ”่ฏฅๆ˜ฏๆœ€ๅคง่พ“ๅ…ฅ+ๆœ€ๅคง่พ“ๅ‡บ
ไนŸไธไธ€ๅฎš๐Ÿค”

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


image
How to put it, according to the Qianwen model, the context should be maximum input + maximum output

@hezhijie0327
Copy link
Contributor Author

็กฎๅฎžๆ˜ฏ็›ธๅŠ ... ๆˆ‘ๆ”นไธ‹

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


It's indeed adding up... I'll change it

@LovelyGuYiMeng
Copy link
Contributor

ๅบ”่ฏฅๆฒก้—ฎ้ข˜ไบ†๏ผŒไฝ†ๆ˜ฏ่ฟ˜ๆœ‰ไธ€็‚นๅฐฑๆ˜ฏarvin่ฏด่ฟ‡ๅฆ‚ๆžœๆจกๅž‹ๆ˜ฏๅ…่ดน็š„๏ผŒ้‚ฃไปทๆ ผinputๅ’Œoutput้ƒฝ่ฆๅ†™0

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


It should be fine, but one more thing is that Arvin said that if the model is free, then both the price input and output should be written with 0.

@hezhijie0327
Copy link
Contributor Author

ๆ›ดๆ–ฐไบ†

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


updated

Copy link

vercel bot commented Sep 26, 2024

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Comments Updated (UTC)
lobe-chat-database โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Sep 27, 2024 7:31am
lobe-chat-preview โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Sep 27, 2024 7:31am

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.

wait for the ci and building pass

@LovelyGuYiMeng
Copy link
Contributor

LovelyGuYiMeng commented Sep 26, 2024

image
ๆททๅ…ƒTurboๆ”ฏๆŒFC๏ผŒๆ”นไธ€ไธ‹๏ผŒๅฆ‚ๆžœๅทฒ็ปไธ‹ไบ†็š„่ฏๅพ…ไผšๅ…ˆๅˆไบ†ๆˆ‘ๅ•็‹ฌๅผ€ไธชPRๆ”นๆ”น

@hezhijie0327
Copy link
Contributor Author

ไธ็”จๅ•็‹ฌๅผ€๏ผŒๅŠ ไธŠไบ†

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


No need to open it separately, add it

@LovelyGuYiMeng
Copy link
Contributor

ไธ็”จๅ•็‹ฌๅผ€๏ผŒๅŠ ไธŠไบ†

ๅ—ฏๅ—ฏ:>

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


No need to open it separately, added

Uh-huh:>

@arvinxx arvinxx merged commit 8ddb41b into lobehub:main Sep 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 Sep 27, 2024
## [Version&nbsp;1.20.0](v1.19.36...v1.20.0)
<sup>Released on **2024-09-27**</sup>

#### โœจ Features

- **misc**: Add Hunyuan(Tencent) model provider.

<br/>

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

#### What's improved

* **misc**: Add Hunyuan(Tencent) model provider, closes [#4147](#4147) ([8ddb41b](8ddb41b))

</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.20.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@hezhijie0327 hezhijie0327 deleted the hunyuan branch September 27, 2024 08:07
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Sep 27, 2024
## [Version&nbsp;1.63.0](v1.62.16...v1.63.0)
<sup>Released on **2024-09-27**</sup>

#### โœจ Features

- **misc**: Add Hunyuan(Tencent) model provider.

<br/>

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

#### What's improved

* **misc**: Add Hunyuan(Tencent) model provider, closes [lobehub#4147](https://github.com/bentwnghk/lobe-chat/issues/4147) ([8ddb41b](8ddb41b))

</details>

<div align="right">

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

</div>
cookieY added a commit to cookieY/lobe-chat that referenced this pull request Sep 29, 2024
* 'main' of github.com:cookieY/lobe-chat:
  ๐Ÿ”– chore(release): v1.20.5 [skip ci]
  ๐Ÿ“ docs: Update docker-compose to use new LOGTO env (lobehub#4199)
  ๐Ÿ‘ท build: optimize image size under glibc env (lobehub#4176)
  ๐Ÿ”– chore(release): v1.20.4 [skip ci]
  โšก perf: remove some blur style to improve performance (lobehub#4085)
  Update dependency unstructured-client to ^0.18.0 (lobehub#4065)
  ๐Ÿ“ docs: Add deployment using ZITADEL authentication services (lobehub#4081)
  ๐Ÿ”– chore(release): v1.20.3 [skip ci]
  ๐Ÿ› fix: improve delete orphan chunks when delete files (lobehub#4179)
  ๐Ÿ“ docs: add new configuration item of clerk singup (lobehub#4188)
  ๐Ÿ“ docs: update model-provider document (lobehub#4181)
  ๐Ÿ”– chore(release): v1.20.2 [skip ci]
  ๐Ÿ’„ style: add zhipu glm-4-flashx model (lobehub#4173)
  ๐Ÿ‘ท build: revert lobehub#4025 (lobehub#4175)
  ๐Ÿ”– chore(release): v1.20.1 [skip ci]
  ๐Ÿ‘ท build: optimize image size under `glibc` env (lobehub#4025)
  ๐Ÿ”– chore(release): v1.20.0 [skip ci]
  โœจ feat: add Hunyuan(Tencent) model provider (lobehub#4147)
  ๐Ÿ”– chore(release): v1.19.36 [skip ci]
  ๐Ÿ’„ style: add llama3.2 model for openrouter provider (lobehub#4151)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐ŸŒ  Feature Request New feature or request | ็‰นๆ€งไธŽๅปบ่ฎฎ 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.

4 participants