mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
🐞 fix: Balance and Token Usage Improvements (#2350)
* 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'`
This commit is contained in:
parent
3411d7a543
commit
6f0eb35365
4 changed files with 29 additions and 11 deletions
|
|
@ -59,9 +59,11 @@ function NavLinks() {
|
|||
<Menu as="div" className="group relative">
|
||||
{({ open }) => (
|
||||
<>
|
||||
{startupConfig?.checkBalance && balanceQuery.data && (
|
||||
{startupConfig?.checkBalance &&
|
||||
balanceQuery.data &&
|
||||
!isNaN(parseFloat(balanceQuery.data)) && (
|
||||
<div className="m-1 ml-3 whitespace-nowrap text-left text-sm text-black dark:text-gray-200">
|
||||
{`Balance: ${balanceQuery.data}`}
|
||||
{`Balance: ${parseFloat(balanceQuery.data).toFixed(2)}`}
|
||||
</div>
|
||||
)}
|
||||
<Menu.Button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue