Skip to content

Conversation

@eric642
Copy link
Contributor

@eric642 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
@eric642
Copy link
Contributor Author

eric642 commented Dec 2, 2025

@apascal07 @hugoaguirre pls review it.

@apascal07
Copy link
Collaborator

@hugoaguirre Take a first pass at this please, test it and make sure everything works.

@hugoaguirre
Copy link
Contributor

Hi @eric642, I think you might need to resolve the CLA for the rest of the contributors in the last commit.

Copy link
Collaborator

@apascal07 apascal07 left a 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.
@eric642 eric642 force-pushed the refactor_plugins_compat_oai branch from debae59 to 48cd657 Compare December 5, 2025 02:19
@eric642
Copy link
Contributor Author

eric642 commented Dec 5, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants