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

🐛 fix: fix issues for client fetch #2753

Merged
merged 18 commits into from
Jun 16, 2024
Merged

Conversation

cy948
Copy link
Contributor

@cy948 cy948 commented Jun 1, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change


  • ♻️ src/app/(main)/settings/llm/components/ProviderConfig/index.tsx: 更改了“客户端请求”功能开关
  • src/store/user/slices/modelList/selectors/keyVaults.ts: 增加与 apikey 相关的 selector
  • ♻️ src/store/user/slices/modelList/selectors/modelConfig.ts: 更改了启用“客户端请求的”规则
  • 🧪 src/store/user/slices/modelList/selectors/modelConfig.test.ts: 测试是否符合启用“客户端请求的”规则

=== 06/08/2024 ===

  • ♻️ src/store/user/slices/modelList/selectors/keyVaults.ts: 更改了 apikey, enpoint selector 的判定,针对 Auzre 及 AWS 做了特殊处理;

=== 06/12/2024 ===

  • 🧪 src/store/user/slices/modelList/selectors/keyVaults.test.ts: 为 isProviderApiKeyNotEmpty 和 isProviderEndpointNotEmpty 补充单测;
  • ♻️ src/store/user/slices/modelList/selectors/modelConfig.ts: 对于 AWSBedrock, isProviderEndpointNotEmpty 在任何时候都为 false;

📝 补充信息 | Additional Information

  • Preview on Vercel
  • 新“客户端请求”功能启用规则
  1. baseURL 和 apiKey 都没填的情况,走服务端;
  2. 如果只填了 baseURL,走客户端;
  3. 根据用户的开关配置;
  4. 默认走服务端
  • Rules to Enable Browser Request
  1. If no baseUrl and apikey input, force on Server.
  2. If only contains baseUrl, force on Client
  3. Follow the user settings.
  4. On Server, by default.

Copy link

vercel bot commented Jun 1, 2024

@cy948 is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @cy948

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.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@cy948 cy948 marked this pull request as draft June 1, 2024 16:01
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.11%. Comparing base (1f30614) to head (8d67738).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2753      +/-   ##
==========================================
+ Coverage   94.10%   94.11%   +0.01%     
==========================================
  Files         359      359              
  Lines       20921    20953      +32     
  Branches     1595     2495     +900     
==========================================
+ Hits        19687    19720      +33     
+ Misses       1234     1233       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cy948 cy948 marked this pull request as ready for review June 3, 2024 17:14
@cy948 cy948 marked this pull request as draft June 3, 2024 17:30
@cy948 cy948 marked this pull request as ready for review June 8, 2024 10:02
@cy948 cy948 changed the title 🚧 wip: improve UX for clientfetch ♻️ refactor: improve UX for clientfetch Jun 8, 2024
@zhuozhiyongde
Copy link
Contributor

看上去补完单测了?蹲一个合并 @arvinxx

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Looks like you have completed the single test? Squat a merge @arvinxx

@arvinxx arvinxx changed the title ♻️ refactor: improve UX for clientfetch 🐛 fix: fi UX for clientfetch Jun 15, 2024
@arvinxx arvinxx changed the title 🐛 fix: fi UX for clientfetch 🐛 fix: fix some issues for client fetch Jun 15, 2024
@arvinxx arvinxx changed the title 🐛 fix: fix some issues for client fetch 🐛 fix: fix issues for client fetch Jun 15, 2024
Copy link

vercel bot commented Jun 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-community ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2024 2:34pm

@arvinxx arvinxx merged commit 6f5be5d into lobehub:main Jun 16, 2024
6 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @cy948 ❤️

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 Jun 16, 2024
### [Version 0.162.25](v0.162.24...v0.162.25)
<sup>Released on **2024-06-16**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix issues for client fetch.

<br/>

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

#### What's fixed

* **misc**: Fix issues for client fetch, closes [#2753](#2753) ([6f5be5d](6f5be5d))

</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 0.162.25 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jun 16, 2024
### [Version&nbsp;1.42.19](v1.42.18...v1.42.19)
<sup>Released on **2024-06-16**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix issues for client fetch.

<br/>

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

#### What's fixed

* **misc**: Fix issues for client fetch, closes [lobehub#2753](https://github.com/bentwnghk/lobe-chat/issues/2753) ([6f5be5d](6f5be5d))

</details>

<div align="right">

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

</div>
@cy948 cy948 deleted the refactor/client-fetch branch June 18, 2024 16:33
ipoly pushed a commit to ipoly/lobe-chat that referenced this pull request Jul 29, 2024
* 🚸 feat: improve UX for clientfetch

* 🚨 fix: circular dependence

* 💡 docs: update comments

* ✅ test: client fetch enabled

* ✅ test: client fetch

* ?? fix: wrong condition

* ✅ test: update tests

* 🐛 fix: wrong selector

* ♻️ refactor: modify vaults selectors

* ⏪ revert: style changed

* ⏪ revert: cancel style fix

* 🧪 test: isProviderEndpointNotEmpty

* 🧪 test: isProviderApiKeyNotEmpty

* ✅ test: isProviderEndpointNotEmpty

* ♻️ refactor: endpoint for aws bedrock

---------

Co-authored-by: Arvin Xu <[email protected]>
ipoly pushed a commit to ipoly/lobe-chat that referenced this pull request Jul 29, 2024
### [Version&nbsp;0.162.25](lobehub/lobe-chat@v0.162.24...v0.162.25)
<sup>Released on **2024-06-16**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix issues for client fetch.

<br/>

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

#### What's fixed

* **misc**: Fix issues for client fetch, closes [lobehub#2753](lobehub#2753) ([6f5be5d](lobehub@6f5be5d))

</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
Projects
None yet
4 participants