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 the agent runtime payload #5250

Merged
merged 10 commits into from
Dec 31, 2024
Merged

Conversation

arvinxx
Copy link
Contributor

@arvinxx arvinxx commented Dec 31, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

将之前设计不合理的 jwtpayload 中的 endpoint 统一为 baseURL,这样后续就可以直接端到端传递 payload ,不需要中间层解构了。后续 client fetch 部分的读取也可以简化一些了 cc @cy948

📝 补充信息 | Additional Information

Copy link

vercel bot commented Dec 31, 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 Dec 31, 2024 5:11pm
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2024 5:11pm

@lobehubbot
Copy link
Member

👍 @arvinxx

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

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.13%. Comparing base (21b6610) to head (1c05def).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #5250     +/-   ##
=========================================
  Coverage   92.12%   92.13%             
=========================================
  Files         570      570             
  Lines       43517    43570     +53     
  Branches     2557     3899   +1342     
=========================================
+ Hits        40089    40142     +53     
  Misses       3428     3428             
Flag Coverage Δ
app 92.13% <100.00%> (+<0.01%) ⬆️
server 97.66% <100.00%> (+<0.01%) ⬆️

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 arvinxx marked this pull request as ready for review December 31, 2024 16:30
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 31, 2024
@lobehubbot
Copy link
Member

❤️ Great PR @arvinxx ❤️

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 Dec 31, 2024
### [Version&nbsp;1.42.2](v1.42.1...v1.42.2)
<sup>Released on **2024-12-31**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the agent runtime payload.

#### 💄 Styles

- **misc**: Add o1 model in openai and openrouter models.

<br/>

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

#### Code refactoring

* **misc**: Refactor the agent runtime payload, closes [#5250](#5250) ([e420ab3](e420ab3))

#### Styles

* **misc**: Add o1 model in openai and openrouter models, closes [#5236](#5236) ([f733852](f733852))

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

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jan 1, 2025
### [Version&nbsp;1.84.2](v1.84.1...v1.84.2)
<sup>Released on **2025-01-01**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the agent runtime payload.

#### 💄 Styles

- **misc**: Add o1 model in openai and openrouter models.

<br/>

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

#### Code refactoring

* **misc**: Refactor the agent runtime payload, closes [lobehub#5250](https://github.com/bentwnghk/lobe-chat/issues/5250) ([e420ab3](e420ab3))

#### Styles

* **misc**: Add o1 model in openai and openrouter models, closes [lobehub#5236](https://github.com/bentwnghk/lobe-chat/issues/5236) ([f733852](f733852))

</details>

<div align="right">

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

</div>
@cy948
Copy link
Contributor

cy948 commented Jan 1, 2025

重构完成之后,client fetch 这里就不需要重新映射这些参数了吗?

switch (provider) {
default:
case ModelProvider.OpenAI: {
providerOptions = {
baseURL: providerAuthPayload?.baseURL,
};
break;
}

@lobehubbot
Copy link
Member

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


After the reconstruction is completed, does client fetch not need to remap these parameters?

switch (provider) {
default:
case ModelProvider.OpenAI: {
providerOptions = {
baseURL: providerAuthPayload?.baseURL,
};
break;
}

AirboZH pushed a commit to yuanze-dev/lobe-chat that referenced this pull request Jan 9, 2025
* refactor the code

* fix locale

* refactor endpoint to baseURL

* add tests

* fix tests

* fix tests

* Update auth.ts

* update snapshot

* fix tests

* fix tests
AirboZH pushed a commit to yuanze-dev/lobe-chat that referenced this pull request Jan 9, 2025
### [Version&nbsp;1.42.2](lobehub/lobe-chat@v1.42.1...v1.42.2)
<sup>Released on **2024-12-31**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the agent runtime payload.

#### 💄 Styles

- **misc**: Add o1 model in openai and openrouter models.

<br/>

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

#### Code refactoring

* **misc**: Refactor the agent runtime payload, closes [lobehub#5250](lobehub#5250) ([e420ab3](lobehub@e420ab3))

#### Styles

* **misc**: Add o1 model in openai and openrouter models, closes [lobehub#5236](lobehub#5236) ([f733852](lobehub@f733852))

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