mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🪙 fix: usage check for reasoning_tokens
This commit is contained in:
parent
c792e3279f
commit
f1ae267850
1 changed files with 6 additions and 1 deletions
|
|
@ -1096,7 +1096,12 @@ ${convo}
|
||||||
{ promptTokens, completionTokens },
|
{ promptTokens, completionTokens },
|
||||||
);
|
);
|
||||||
|
|
||||||
if (typeof usage === 'object' && typeof usage.reasoning_tokens === 'number') {
|
if (
|
||||||
|
usage &&
|
||||||
|
typeof usage === 'object' &&
|
||||||
|
'reasoning_tokens' in usage &&
|
||||||
|
typeof usage.reasoning_tokens === 'number'
|
||||||
|
) {
|
||||||
await spendTokens(
|
await spendTokens(
|
||||||
{
|
{
|
||||||
context: 'reasoning',
|
context: 'reasoning',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue