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 litellm streaming usage issue #6734

Merged
merged 15 commits into from
Mar 6, 2025
Merged

Conversation

arvinxx
Copy link
Contributor

@arvinxx arvinxx commented Mar 5, 2025

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

  • 修正与 litellm 集成的兼容性
  • 开启 stream 时默认 include usage
  • 重构 Token Usage 的数据流

📝 补充信息 | Additional Information

Copy link

vercel bot commented Mar 5, 2025

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 Mar 6, 2025 6:53pm
lobe-chat-desktop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2025 6:53pm
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2025 6:53pm

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 5, 2025
@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.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added the 🐛 Bug Something isn't working | 缺陷 label Mar 5, 2025
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 70.68493% with 107 lines in your changes missing coverage. Please review.

Project coverage is 91.30%. Comparing base (15d96d5) to head (ce66b6d).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...es/Conversation/Extras/Usage/UsageDetail/index.tsx 0.00% 77 Missing ⚠️
...onversation/Extras/Usage/UsageDetail/ModelCard.tsx 3.70% 26 Missing ⚠️
...es/Conversation/Extras/Usage/UsageDetail/tokens.ts 93.84% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6734      +/-   ##
==========================================
+ Coverage   91.23%   91.30%   +0.06%     
==========================================
  Files         721      724       +3     
  Lines       67635    67967     +332     
  Branches     4488     3100    -1388     
==========================================
+ Hits        61708    62056     +348     
+ Misses       5927     5911      -16     
Flag Coverage Δ
app 91.30% <70.68%> (+0.06%) ⬆️
server 97.60% <ø> (+0.02%) ⬆️

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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 6, 2025
@arvinxx arvinxx merged commit 9f09952 into main Mar 6, 2025
29 of 30 checks passed
@arvinxx arvinxx deleted the refactor/force-include-usage branch March 6, 2025 18:46
@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 Mar 6, 2025
### [Version&nbsp;1.68.10](v1.68.9...v1.68.10)
<sup>Released on **2025-03-06**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix litellm streaming usage and refactor the usage chunk.

<br/>

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

#### What's fixed

* **misc**: Fix litellm streaming usage and refactor the usage chunk, closes [#6734](#6734) ([9f09952](9f09952))

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

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Mar 6, 2025
### [Version&nbsp;1.109.4](v1.109.3...v1.109.4)
<sup>Released on **2025-03-06**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix litellm streaming usage and refactor the usage chunk.

<br/>

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

#### What's fixed

* **misc**: Fix litellm streaming usage and refactor the usage chunk, closes [lobehub#6734](https://github.com/bentwnghk/lobe-chat/issues/6734) ([9f09952](9f09952))

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

2 participants