aihezu 2.8.6 → 2.8.7
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 +7 -11
- package/package.json +1 -1
package/commands/usage.js
CHANGED
|
@@ -434,11 +434,13 @@ function displayUsageStats(stats, origin, source) {
|
|
|
434
434
|
return l - c;
|
|
435
435
|
})();
|
|
436
436
|
|
|
437
|
-
//
|
|
438
|
-
const currentDailyRequests = (stats.currentDailyRequests !== undefined) ? stats.currentDailyRequests
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
const
|
|
437
|
+
// 提取日请求次数和 Token 用量(API 中 currentWindowRequests/Tokens 实际为日数据)
|
|
438
|
+
const currentDailyRequests = (stats.currentDailyRequests !== undefined) ? stats.currentDailyRequests
|
|
439
|
+
: (limits.currentDailyRequests !== undefined) ? limits.currentDailyRequests
|
|
440
|
+
: (stats.currentWindowRequests !== undefined) ? stats.currentWindowRequests : limits.currentWindowRequests;
|
|
441
|
+
const currentDailyTokens = (stats.currentDailyTokens !== undefined) ? stats.currentDailyTokens
|
|
442
|
+
: (limits.currentDailyTokens !== undefined) ? limits.currentDailyTokens
|
|
443
|
+
: (stats.currentWindowTokens !== undefined) ? stats.currentWindowTokens : limits.currentWindowTokens;
|
|
442
444
|
|
|
443
445
|
console.log(`域名: ${origin}`);
|
|
444
446
|
console.log(`来源: ${source}`);
|
|
@@ -465,12 +467,6 @@ function displayUsageStats(stats, origin, source) {
|
|
|
465
467
|
if (windowRemaining !== null) {
|
|
466
468
|
console.log(`窗口剩余: ${formatCost(windowRemaining)}`);
|
|
467
469
|
}
|
|
468
|
-
if (asNumber(currentWindowRequests) !== null || asNumber(currentWindowTokens) !== null) {
|
|
469
|
-
const parts = [];
|
|
470
|
-
if (asNumber(currentWindowRequests) !== null) parts.push(`请求 ${formatNumber(currentWindowRequests)} 次`);
|
|
471
|
-
if (asNumber(currentWindowTokens) !== null) parts.push(`Token ${formatCompactNumber(currentWindowTokens)}`);
|
|
472
|
-
console.log(`窗口统计: ${parts.join(' | ')}`);
|
|
473
|
-
}
|
|
474
470
|
const windowStartText = formatDateTime(windowStartTime);
|
|
475
471
|
const windowEndText = formatDateTime(windowEndTime);
|
|
476
472
|
if (windowStartText !== '-' || windowEndText !== '-') {
|