-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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: failure when usage is none #1253
Conversation
PR Description updated to latest commit (8695629)
|
PR Review 🔍
|
PR Code Suggestions ✨
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1253 +/- ##
==========================================
- Coverage 70.22% 70.19% -0.04%
==========================================
Files 316 316
Lines 18860 18860
==========================================
- Hits 13245 13239 -6
- Misses 5615 5621 +6 ☔ View full report in Codecov by Sentry. |
LGTM |
nice |
User description
Features
Feature Docs
Influence
Result
Other
PR Type
Bug fix
Description
chunk.usage
was present but had aNone
value. Now, the code checks thatchunk.usage
is truthy before proceeding to use it.Changes walkthrough 📝
openai_api.py
Fix handling of `None` value in `chunk.usage`
metagpt/provider/openai_api.py
chunk.usage
is not only present but alsotruthy before using it.