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

♻️ refactor: refactor *_PROXY_URL, get var from ENV #4747

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Nov 21, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

  1. 重构 *_PROXY_URL,直接从环境变量(process.env.*_PROXY_URL)中获取
文件 更改详情
src/config/llm.ts 移除所有 *_PROXY_URL
src/server/modules/AgentRuntime/index.ts 直接从环境变量中获取
src/server/globalConfig/index.ts 移除 getLLMConfig(),直接从环境变量中获取 process.env.OLLAMA_PROXY_URL
src/app/(backend)/_deprecated/createBizOpenAI/createAzureOpenai.ts
src/app/(backend)/_deprecated/createBizOpenAI/createOpenai.ts 直接从环境变量中获取 process.env.OPENAI_PROXY_URL
  1. 增加 XAI_PROXY_URL
  2. 补齐 MOONSHOT_PROXY_URL 配置,在 src/config/modelProviders/moonshot.ts 中缺少 proxyUrl 字段
Before After
image image

📝 补充信息 | Additional Information

Copy link

vercel bot commented Nov 21, 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.

@hezhijie0327 hezhijie0327 marked this pull request as ready for review November 21, 2024 06:15
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 21, 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 the 🐛 Bug Something isn't working | 缺陷 label Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 82.85714% with 6 lines in your changes missing coverage. Please review.

Project coverage is 92.31%. Comparing base (3f8d3db) to head (15ea887).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/server/modules/AgentRuntime/index.ts 80.64% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4747      +/-   ##
==========================================
- Coverage   92.32%   92.31%   -0.01%     
==========================================
  Files         528      528              
  Lines       37020    37002      -18     
  Branches     3690     2370    -1320     
==========================================
- Hits        34179    34160      -19     
- Misses       2841     2842       +1     
Flag Coverage Δ
app 92.31% <82.85%> (-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:

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Nov 21, 2024
@hezhijie0327 hezhijie0327 changed the title 🐛 fix: fix XAI_PROXY_URL env missing ♻️ refactor: refactor *_PROXY_URL, get var from ENV Nov 21, 2024
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 21, 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-database ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 24, 2024 10:05am
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 24, 2024 10:05am

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.

棒 👍 感觉下一步就可以简化 AgentRuntime 的传参了

@arvinxx arvinxx merged commit 7c9e88e into lobehub:main Nov 24, 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 Nov 24, 2024
### [Version&nbsp;1.32.8](v1.32.7...v1.32.8)
<sup>Released on **2024-11-24**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix `XAI_PROXY_URL` env missing.

<br/>

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

#### What's fixed

* **misc**: Fix `XAI_PROXY_URL` env missing, closes [#4747](#4747) ([7c9e88e](7c9e88e))

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

The release is available on:

Your semantic-release bot 📦🚀

@hezhijie0327 hezhijie0327 deleted the xaiProxyURL branch November 24, 2024 21:48
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Nov 24, 2024
### [Version&nbsp;1.74.5](v1.74.4...v1.74.5)
<sup>Released on **2024-11-24**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix `XAI_PROXY_URL` env missing.

#### 💄 Styles

- **misc**: Support to reset fetched models.

<br/>

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

#### What's fixed

* **misc**: Fix `XAI_PROXY_URL` env missing, closes [lobehub#4747](https://github.com/bentwnghk/lobe-chat/issues/4747) ([7c9e88e](7c9e88e))

#### Styles

* **misc**: Support to reset fetched models, closes [lobehub#4260](https://github.com/bentwnghk/lobe-chat/issues/4260) ([22480a9](22480a9))

</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
🐛 Bug Something isn't working | 缺陷 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.

[Bug] I guess XAI_PROXY_URL is not working
3 participants