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: Balance and Token Usage Improvements #2350

Merged
merged 5 commits into from
Apr 8, 2024
Merged

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Apr 8, 2024

Summary

This set of changes focuses on improving the handling of balance and token usage. The primary changes include:

  • Ensures token usage is recorded correctly for OpenAIClient: titleConvo when set to completion title method.
  • Fixes an incomplete condition for OpenAIClient: titleConvo introduced by Cohere handling: 🧠 feat: Cohere support as Custom Endpoint #2328
  • Refactors the NavLinks component to display the user's balance with a maximum of two decimal places.
  • Fixes an issue where a zero balance was not rendered properly in the NavLinks component.
  • Prevents negative multiplier edge case when recording balance transactions
  • Ensures the user's balance cannot become negative when creating transactions, a minimum of 0 is now enforced.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules

@danny-avila danny-avila changed the title fix: Balance Edge Cases 🐞 fix: Balance and Token Usage Improvements Apr 8, 2024
@danny-avila danny-avila merged commit 6f0eb35 into main Apr 8, 2024
3 checks passed
@danny-avila danny-avila deleted the balance-fix branch April 8, 2024 03:28
jinzishuai pushed a commit to aitok-ai/LibreChat that referenced this pull request May 20, 2024
* fix(processModelData): handle `openrouter/auto` edge case

* fix(Tx.create): prevent negative multiplier edge case and prevent balance from becoming negative

* fix(NavLinks): render 0 balance properly

* refactor(NavLinks): show only up to 2 decimal places for balance

* fix(OpenAIClient/titleConvo): fix cohere condition and record token usage for `this.options.titleMethod === 'completion'`
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
* fix(processModelData): handle `openrouter/auto` edge case

* fix(Tx.create): prevent negative multiplier edge case and prevent balance from becoming negative

* fix(NavLinks): render 0 balance properly

* refactor(NavLinks): show only up to 2 decimal places for balance

* fix(OpenAIClient/titleConvo): fix cohere condition and record token usage for `this.options.titleMethod === 'completion'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant