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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

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.15%. Comparing base (b4a160b) to head (2139cb6).
Report is 2 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.59%   92.15%   -0.45%     
==========================================
  Files         642      642              
  Lines       56124    56824     +700     
  Branches     2693     4243    +1550     
==========================================
+ Hits        51966    52364     +398     
- Misses       4158     4460     +302     
Flag Coverage ฮ”
app 92.15% <64.17%> (-0.45%) โฌ‡๏ธ
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 Updated (UTC)
lobe-chat-database โœ… Ready (Inspect) Visit Preview Jan 15, 2025 4:02am

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐Ÿ’„ Design Design an style | ๆ ทๅผ้—ฎ้ข˜ 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