-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat: return usage for openai providers #7462
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
Conversation
💡 To request a new review, comment |
PR not ready yet, putting it up to run tests |
Is this planned to have a plugin to the UI at some point in time, or is it a hook to backend processes. More curious than anything... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the tests! Lmk your thoughts on UsageInfo
.
type UsageInfo = { | ||
total_tokens: number; | ||
completion_tokens: number; | ||
prompt_tokens: number; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both of the UsageInfo
types in this PR are actually from CompletionUsage
in openai/resources/index
? If we just need a subset of the properties we could use an Omit
or Pick
.
abe5c74
to
cbbebe2
Compare
@chezsmithy This is going to be used for our updated billing system, coming very soon! |
🎉 This PR is included in version 1.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
[ What changed? Feel free to be brief. ]
AI Code Review
@continue-general-review
or@continue-detailed-review
Checklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Adds token usage reporting (prompt, completion, total) to Gemini and Relace adapters for both streaming and non‑stream responses, enabling cost and quota tracking. Tests updated to expect usage for supported providers.
New Features
Migration