-
Notifications
You must be signed in to change notification settings - Fork 602
refactor(plugins/compat-oai): use ChatCompletionAccumulator for strea… #3870
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
base: main
Are you sure you want to change the base?
Conversation
eric642
commented
Dec 2, 2025
- Simplified generateStream by using openai-go's ChatCompletionAccumulator
- Removed manual tool call accumulation logic (currentToolCall, toolCallCollects)
- Created convertChatCompletionToModelResponse helper for unified response conversion
- Added support for detailed token usage fields:
- ThoughtsTokens (reasoning tokens)
- CachedContentTokens (cached tokens)
- Audio, prediction tokens in custom field
- Added support for refusal messages and system fingerprint metadata
- Refactored generateComplete to reuse convertChatCompletionToModelResponse
…ming - Simplified generateStream by using openai-go's ChatCompletionAccumulator - Removed manual tool call accumulation logic (currentToolCall, toolCallCollects) - Created convertChatCompletionToModelResponse helper for unified response conversion - Added support for detailed token usage fields: - ThoughtsTokens (reasoning tokens) - CachedContentTokens (cached tokens) - Audio, prediction tokens in custom field - Added support for refusal messages and system fingerprint metadata - Refactored generateComplete to reuse convertChatCompletionToModelResponse
|
@apascal07 @hugoaguirre pls review it. |
|
@hugoaguirre Take a first pass at this please, test it and make sure everything works. |
|
Hi @eric642, I think you might need to resolve the CLA for the rest of the contributors in the last commit. |
apascal07
left a comment
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.
LGTM but I'm less familiar with this code, @hugoaguirre to verify.
Remove unused conditional check and commented code in streaming logic.
debae59 to
48cd657
Compare
|
@hugoaguirre Sorry, I need you to re-review this. Previously, there was a commit message that was generated directly by Claude. The anthropic email address was mistakenly entered, resulting in a pending status for Claude. |