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 Gitee AI model provider #4716

Merged
merged 12 commits into from
Nov 25, 2024
Merged

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Nov 17, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

  1. 模型供应商图标添加 [Request] 帮忙增加下 Gitee 模型供应商图标 lobe-icons#53
  2. 禁用客户端请求模式(不支持)
  3. 引入自定义变量 GITEE_AI_API_KEY GITEE_AI_MODEL_LIST

Note:

  1. code-raccoon-v1 对话流存在结构问题
{"data":{"id":"9d58d703-7f48-4c21-b09e-001b9fb47d81","usage":{"prompt_tokens":1,"completion_tokens":10,"knowledge_tokens":0,"total_tokens":11},"choices":[{"index":0,"role":"assistant","message":"Hello! How can I assist you today?\u003c|endofblock|\u003e","finish_reason":"stop","text":""}],"plugins":{}}}
  1. 获取 API Key https://ai.gitee.com
    image

📝 补充信息 | Additional Information

模块 截图
模型列表 imageimage
对话 image
工具调用 image

Copy link

vercel bot commented Nov 17, 2024

@hezhijie0327 is attempting to deploy a commit to the LobeChat Community 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 Nov 17, 2024
@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 Model Provider 模型服务商 🌠 Feature Request New feature or request | 特性与建议 labels Nov 17, 2024
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

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

Project coverage is 92.30%. Comparing base (22480a9) to head (ae55b8a).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/server/modules/AgentRuntime/index.ts 14.28% 6 Missing ⚠️
src/libs/agent-runtime/AgentRuntime.ts 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #4716     +/-   ##
=========================================
  Coverage   92.30%   92.30%             
=========================================
  Files         528      530      +2     
  Lines       37013    37118    +105     
  Branches     2518     3688   +1170     
=========================================
+ Hits        34163    34260     +97     
- Misses       2850     2858      +8     
Flag Coverage Δ
app 92.30% <91.42%> (+<0.01%) ⬆️
server 96.17% <ø> (ø)

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.


🚨 Try these New Features:

@bluishoul
Copy link

bluishoul commented Nov 19, 2024

Hi @hezhijie0327, thanks for adding support for Gitee AI, I'm working on the Gitee AI project, and I have some change requests for the PR for some branding stuff. Could you please change Gitee to Gitee AI, for example:

  • Variables:
- GITEE_API_KEY="" GITEE_MODEL_LIST=""
+ GITEE_AI_API_KEY="" GITEE_AI_MODEL_LIST=""
  • Filename:
- src/config/modelProviders/gitee.ts
+ src/config/modelProviders/giteeai.ts

I will send my review as far as I could (there no good way to change the filename in the PR directly).

Thank you.

@hezhijie0327
Copy link
Contributor Author

Sure. Will update later

Dockerfile Outdated Show resolved Hide resolved
Dockerfile.database Outdated Show resolved Hide resolved
src/app/(main)/settings/llm/ProviderList/providers.tsx Outdated Show resolved Hide resolved
src/app/(main)/settings/llm/ProviderList/providers.tsx Outdated Show resolved Hide resolved
src/config/llm.ts Outdated Show resolved Hide resolved
src/libs/agent-runtime/gitee/index.test.ts Outdated Show resolved Hide resolved
src/libs/agent-runtime/gitee/index.ts Outdated Show resolved Hide resolved
src/libs/agent-runtime/types/type.ts Outdated Show resolved Hide resolved
src/server/modules/AgentRuntime/index.ts Outdated Show resolved Hide resolved
src/types/user/settings/keyVaults.ts Outdated Show resolved Hide resolved
@hezhijie0327 hezhijie0327 changed the title ✨ feat: add Gitee model provider ✨ feat: add Gitee AI model provider Nov 19, 2024
Copy link

vercel bot commented Nov 24, 2024

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 Nov 24, 2024 10:25am

@arvinxx arvinxx merged commit f1cb0af into lobehub:main Nov 25, 2024
5 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 Nov 25, 2024
## [Version&nbsp;1.33.0](v1.32.9...v1.33.0)
<sup>Released on **2024-11-25**</sup>

#### ✨ Features

- **misc**: Add Gitee AI model provider.

<br/>

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

#### What's improved

* **misc**: Add Gitee AI model provider, closes [#4716](#4716) ([f1cb0af](f1cb0af))

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

The release is available on:

Your semantic-release bot 📦🚀

@hezhijie0327 hezhijie0327 deleted the gitee branch November 25, 2024 02:32
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Nov 25, 2024
## [Version&nbsp;1.75.0](v1.74.5...v1.75.0)
<sup>Released on **2024-11-25**</sup>

#### ✨ Features

- **misc**: Add Gitee AI model provider.

<br/>

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

#### What's improved

* **misc**: Add Gitee AI model provider, closes [lobehub#4716](https://github.com/bentwnghk/lobe-chat/issues/4716) ([f1cb0af](f1cb0af))

</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
🌠 Feature Request New feature or request | 特性与建议 Model Provider 模型服务商 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