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

๐Ÿ’„ style: add ModelFetcher for supported provider #5316

Merged
merged 28 commits into from
Jan 21, 2025

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Jan 6, 2025

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

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

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

  1. ่กฅ้ฝๆ‰€ๆœ‰ๆ”ฏๆŒไปŽ v1/models ๆˆ–่‡ชๅฎšไน‰ Endpoint ่Žทๅ–ๆจกๅž‹ๅˆ—่กจ็š„ๆไพ›ๅ•†
  2. ็งป้™คไธๆ”ฏๆŒ/ๆš‚ๆ— ้€‚้…ๆจกๅž‹ๅˆ—่กจ็š„ไพ›ๅบ”ๅ•†้…็ฝฎไธญ็š„ showModelFetcher
azureOpenai, bedrock, hunyuan, minimax, perplexity, spark, taichu, upstage, wenxin
  1. ๆ›ดๆ–ฐ Ai360, Taichu, GiteeAI, Zhipu, Upstage ้ป˜่ฎคๆจกๅž‹ๅˆ—่กจ๏ผŒ้€‚้… aiModels
  2. ๅŠ ๅ…ฅ 2025-01-15 ๅ‘ๅธƒ็š„ MiniMax-Text-01 ๆจกๅž‹ MiniMax-Text-01
  3. ๅŠ ๅ…ฅ 2025-01-14 ๅ‘ๅธƒ็š„ moonshot-v1-8k-vision-preview ่ง†่ง‰ๆจกๅž‹๏ผŒๅนถ้€‚้… vision ๆ ‡็ญพ ไฝฟ็”จ Kimi ่ง†่ง‰ๆจกๅž‹๏ผˆVision๏ผ‰

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

ๆไพ›ๅ•† ๆ•ˆๆžœๆˆชๅ›พ ๆไพ›ๅ•† ๆ•ˆๆžœๆˆชๅ›พ ๆไพ›ๅ•† ๆ•ˆๆžœๆˆชๅ›พ
Ai360 image DeepSeek image InternLM image
Moonshot image Stepfun image ZeroOne image
Qwen image Groq image Mistral image
FireworksAI image GiteeAI image SiliconCloud image
Baichuan image SenseNova image Zhipu image
Anthropic image Google image HuggingFace image

Copy link

vercel bot commented Jan 6, 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:L This PR changes 100-499 lines, ignoring generated files. label Jan 6, 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.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚
ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

@dosubot dosubot bot added the ๐Ÿ’„ Design Design an style | ๆ ทๅผ้—ฎ้ข˜ label Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 64.17556% with 302 lines in your changes missing coverage. Please review.

Project coverage is 92.20%. Comparing base (4fc4fa6) to head (b4501de).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/libs/agent-runtime/huggingface/index.ts 24.32% 28 Missing โš ๏ธ
src/libs/agent-runtime/siliconcloud/index.ts 26.47% 25 Missing โš ๏ธ
src/libs/agent-runtime/anthropic/index.ts 33.33% 24 Missing โš ๏ธ
src/libs/agent-runtime/google/index.ts 42.50% 23 Missing โš ๏ธ
src/libs/agent-runtime/sensenova/index.ts 28.57% 20 Missing โš ๏ธ
src/libs/agent-runtime/giteeai/index.ts 32.14% 19 Missing โš ๏ธ
src/libs/agent-runtime/groq/index.ts 34.48% 19 Missing โš ๏ธ
src/libs/agent-runtime/zhipu/index.ts 45.71% 19 Missing โš ๏ธ
src/libs/agent-runtime/baichuan/index.ts 42.85% 16 Missing โš ๏ธ
src/libs/agent-runtime/qwen/index.ts 36.00% 16 Missing โš ๏ธ
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5316      +/-   ##
==========================================
- Coverage   92.64%   92.20%   -0.44%     
==========================================
  Files         639      639              
  Lines       56076    56776     +700     
  Branches     2686     4039    +1353     
==========================================
+ Hits        51949    52348     +399     
- Misses       4127     4428     +301     
Flag Coverage ฮ”
app 92.20% <64.17%> (-0.44%) โฌ‡๏ธ
server 97.99% <รธ> (รธ)

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.

@arvinxx
Copy link
Contributor

arvinxx commented Jan 6, 2025

็ญ‰ #5158 ๅˆๅนถๅŽๅ†ๆ PR ๅ“ˆ๏ผŒ่ฟ‘ๆœŸไธๅ†ๆŽฅๅ—็Žฐๆœ‰็š„ provider ๅ˜ๆ›ด็š„PRใ€‚็ญ‰ #5158 ๅˆๅนถๅŽๅ†ๆ~

@lobehubbot
Copy link
Member

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


Wait until #5158 is merged before submitting a PR. PRs for existing provider changes will no longer be accepted in the near future. Will mention it again after #5158 is merged~

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 7, 2025
@hezhijie0327
Copy link
Contributor Author

@arvinxx ๆ”น้€ ๅฅฝไบ†๏ผŒ็†่ฎบไธŠๆ‰€ๆœ‰่ƒฝ้€‚้…็š„๏ผŒ้ƒฝๆ”ฏๆŒ่‡ชๅŠจ่Žทๅ–ๆจกๅž‹ๅˆ—่กจไบ†๏ฝž

@lobehubbot
Copy link
Member

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


@arvinxx The transformation has been completed. In theory, everything that can be adapted supports automatically obtaining the model list~

Copy link

vercel bot commented Jan 14, 2025

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 Jan 18, 2025 7:39am
lobe-chat-preview ๐Ÿ›‘ Canceled (Inspect) Jan 18, 2025 7:39am

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.

LOBE_DEFAULT_MODEL_LIST ้œ€่ฆไปŽ aiModels ๅผ•ๅ…ฅ๏ผŒๅŽ็ปญ modelProviders ้‡Œ็š„่ฟ™ไธชๅ˜้‡ไผš่ขซๅˆ ้™ค

@vercel vercel bot temporarily deployed to Preview โ€“ lobe-chat-database January 14, 2025 17:32 Inactive
@hezhijie0327
Copy link
Contributor Author

LOBE_DEFAULT_MODEL_LIST ้œ€่ฆไปŽ aiModels ๅผ•ๅ…ฅ๏ผŒๅŽ็ปญ modelProviders ้‡Œ็š„่ฟ™ไธชๅ˜้‡ไผš่ขซๅˆ ้™ค

ๅ…จ้ƒจๅˆ‡ๆขๅˆฐ @/config/aiModels ไบ†

@lobehubbot
Copy link
Member

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


LOBE_DEFAULT_MODEL_LIST needs to be imported from aiModels, and this variable in modelProviders will be deleted later.

All switched to @/config/aiModels

@@ -3,7 +3,7 @@ import utc from 'dayjs/plugin/utc';
import OpenAI, { ClientOptions } from 'openai';
import { Stream } from 'openai/streaming';

import { LOBE_DEFAULT_MODEL_LIST } from '@/config/modelProviders';
Copy link
Contributor

Choose a reason for hiding this comment

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

่ฟ™้‡Œๅ…ˆไธๆ”น๏ผŒ้œ€่ฆๅ…ผๅฎนๅŽŸๆœ‰ๅฎž็Žฐ๏ผŒ็ญ‰V2ๅ†ๆ”น

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ๅทฒๅ›ž้€€

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.

ๅŽŸๆœ‰ไฝฟ็”จ LOBE_DEFAULT_MODEL_LIST ็š„ๅœฐๆ–น้œ€่ฆไฟๆŒ็Žฐ็Šถ๏ผŒ็”จไปฅๅ…ผๅฎนๆ—ง็‰ˆๅฎž็Žฐใ€‚ๆ‰€ๆœ‰ๆ–ฐๅขž้ƒฝ่ตฐ aiModels

@hezhijie0327
Copy link
Contributor Author

ๅŽŸๆœ‰ไฝฟ็”จ LOBE_DEFAULT_MODEL_LIST ็š„ๅœฐๆ–น้œ€่ฆไฟๆŒ็Žฐ็Šถ๏ผŒ็”จไปฅๅ…ผๅฎนๆ—ง็‰ˆๅฎž็Žฐใ€‚ๆ‰€ๆœ‰ๆ–ฐๅขž้ƒฝ่ตฐ aiModels

ๅฅฝไบ†๏ผŒๅทฒๅ›ž้€€

@lobehubbot
Copy link
Member

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


The original use of LOBE_DEFAULT_MODEL_LIST needs to remain current to be compatible with older implementations. All new additions go to aiModels

OK, rolled back

@hezhijie0327
Copy link
Contributor Author

hezhijie0327 commented Jan 15, 2025

Kimi ๅˆšๅ‘ไบ†่ง†่ง‰ๆจกๅž‹๏ผŒ็จๅŽๅŠ ไธช่ง†่ง‰ๆจกๅž‹ๅˆคๅฎš๏ผŒๅทฒ่ƒฝๆ‹ฟๅˆฐๆจกๅž‹ไฟกๆฏไฝ†็ผบๅฐ‘visionๆ ‡็ญพ ๅทฒ้€‚้…

Before After
image image

* Update moonshot.ts

* Update index.ts

* Update moonshot.ts
@vercel vercel bot temporarily deployed to Preview โ€“ lobe-chat-preview January 18, 2025 07:39 Inactive
@arvinxx arvinxx merged commit a189c81 into lobehub:main Jan 21, 2025
4 of 7 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 Jan 21, 2025
### [Version&nbsp;1.47.13](v1.47.12...v1.47.13)
<sup>Released on **2025-01-21**</sup>

#### ๐Ÿ’„ Styles

- **misc**: Add `ModelFetcher` for supported providers.

<br/>

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

#### Styles

* **misc**: Add `ModelFetcher` for supported providers, closes [#5316](#5316) [#252](#252) ([a189c81](a189c81))

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

The release is available on:

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

@hezhijie0327 hezhijie0327 deleted the fetchModels branch January 21, 2025 22:25
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jan 21, 2025
### [Version&nbsp;1.89.7](v1.89.6...v1.89.7)
<sup>Released on **2025-01-21**</sup>

#### ๐Ÿ’„ Styles

- **misc**: Add `ModelFetcher` for supported providers.

<br/>

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

#### Styles

* **misc**: Add `ModelFetcher` for supported providers, closes [lobehub#5316](https://github.com/bentwnghk/lobe-chat/issues/5316) [lobehub#252](https://github.com/bentwnghk/lobe-chat/issues/252) ([a189c81](a189c81))

</details>

<div align="right">

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

</div>
gecsp pushed a commit to gecsp/lobe-chat that referenced this pull request Jan 22, 2025
* ๐Ÿ’„ style: add ModelFetcher for supported provider

* ๐Ÿ’„ style: add Mistral ModelFetcher support

* ๐Ÿ’„ style: add `glm-zero-preview` model for Zhipu

* ๐Ÿ’„ style: add more supported providers

* ๐Ÿ’„ style: add SenseNova & Baichuan support with custom models endpoint

* ๐Ÿ› fix: fix fc keyword typo, should lowercase

* ๐Ÿ’„ style: update aiModels list

* โ™ป๏ธ refactor: use aiModels sheme

* Revert "โ™ป๏ธ refactor: use aiModels sheme" (lobehub#252)

This reverts commit 049662d.

* ๐Ÿ› fix: fix `firefunction` series not set as functionCall

* ๐Ÿ’„ style: add Zhipu FetchModel support

* ๐Ÿ’„ style: add Anthropic FetchModel support

* ๐Ÿ’„ style: add Google ModelFetch support

* ๐Ÿ’„ style: add HuggingFace ModelFetch support

* ๐Ÿ› fix: fix stepfun fc tag

* โ™ป๏ธ refactor: refactor `LOBE_DEFAULT_MODEL_LIST` import

* ๐Ÿ”จ chore: revert some changes

* ๐Ÿ› fix: fix aiModels import

* ๐Ÿ› fix: fix CI error

* ๐Ÿ’„ style: add `MiniMax-Text-01`

* ๐Ÿ’„ style: add vision model support for Moonshot

* Update moonshot.ts

* Update index.ts

* Update moonshot.ts
gecsp pushed a commit to gecsp/lobe-chat that referenced this pull request Jan 22, 2025
### [Version&nbsp;1.47.13](lobehub/lobe-chat@v1.47.12...v1.47.13)
<sup>Released on **2025-01-21**</sup>

#### ๐Ÿ’„ Styles

- **misc**: Add `ModelFetcher` for supported providers.

<br/>

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

#### Styles

* **misc**: Add `ModelFetcher` for supported providers, closes [lobehub#5316](lobehub#5316) [lobehub#252](lobehub#252) ([a189c81](lobehub@a189c81))

</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:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants