This commit is contained in:
Han Xiao 2025-02-12 15:56:19 +08:00
commit cdb56cc80c

View File

@ -15,7 +15,7 @@ export class TokenTracker extends EventEmitter {
const asyncLocalContext = process.asyncLocalContext as any;
this.on('usage', () => {
if (asyncLocalContext.available()) {
asyncLocalContext.ctx.chargeAmount = this.getTotalUsage();
asyncLocalContext.ctx.chargeAmount = this.getTotalUsage().totalTokens;
}
});