aihezu 2.8.5 → 2.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/usage.js +10 -2
- package/package.json +1 -1
package/commands/usage.js
CHANGED
|
@@ -434,7 +434,9 @@ function displayUsageStats(stats, origin, source) {
|
|
|
434
434
|
return l - c;
|
|
435
435
|
})();
|
|
436
436
|
|
|
437
|
-
//
|
|
437
|
+
// 提取请求次数和 Token 用量
|
|
438
|
+
const currentDailyRequests = (stats.currentDailyRequests !== undefined) ? stats.currentDailyRequests : limits.currentDailyRequests;
|
|
439
|
+
const currentDailyTokens = (stats.currentDailyTokens !== undefined) ? stats.currentDailyTokens : limits.currentDailyTokens;
|
|
438
440
|
const currentWindowRequests = (stats.currentWindowRequests !== undefined) ? stats.currentWindowRequests : limits.currentWindowRequests;
|
|
439
441
|
const currentWindowTokens = (stats.currentWindowTokens !== undefined) ? stats.currentWindowTokens : limits.currentWindowTokens;
|
|
440
442
|
|
|
@@ -448,6 +450,12 @@ function displayUsageStats(stats, origin, source) {
|
|
|
448
450
|
if (dailyRemaining !== null) {
|
|
449
451
|
console.log(`日剩余: ${formatCost(dailyRemaining)}`);
|
|
450
452
|
}
|
|
453
|
+
if (asNumber(currentDailyRequests) !== null || asNumber(currentDailyTokens) !== null) {
|
|
454
|
+
const parts = [];
|
|
455
|
+
if (asNumber(currentDailyRequests) !== null) parts.push(`请求 ${formatNumber(currentDailyRequests)} 次`);
|
|
456
|
+
if (asNumber(currentDailyTokens) !== null) parts.push(`Token ${formatCompactNumber(currentDailyTokens)}`);
|
|
457
|
+
console.log(`日统计: ${parts.join(' | ')}`);
|
|
458
|
+
}
|
|
451
459
|
|
|
452
460
|
console.log('');
|
|
453
461
|
console.log(
|
|
@@ -460,7 +468,7 @@ function displayUsageStats(stats, origin, source) {
|
|
|
460
468
|
if (asNumber(currentWindowRequests) !== null || asNumber(currentWindowTokens) !== null) {
|
|
461
469
|
const parts = [];
|
|
462
470
|
if (asNumber(currentWindowRequests) !== null) parts.push(`请求 ${formatNumber(currentWindowRequests)} 次`);
|
|
463
|
-
if (asNumber(currentWindowTokens) !== null) parts.push(`Token ${
|
|
471
|
+
if (asNumber(currentWindowTokens) !== null) parts.push(`Token ${formatCompactNumber(currentWindowTokens)}`);
|
|
464
472
|
console.log(`窗口统计: ${parts.join(' | ')}`);
|
|
465
473
|
}
|
|
466
474
|
const windowStartText = formatDateTime(windowStartTime);
|