@polka-codes/cli-shared 0.9.13 → 0.9.14
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/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27928,9 +27928,9 @@ class UsageMeter {
|
|
|
27928
27928
|
get usage() {
|
|
27929
27929
|
return { ...this.#totals, messageCount: this.#calls };
|
|
27930
27930
|
}
|
|
27931
|
-
printUsage() {
|
|
27931
|
+
printUsage(customConsole = console) {
|
|
27932
27932
|
const u = this.usage;
|
|
27933
|
-
|
|
27933
|
+
customConsole.log(`Usage - messages: ${u.messageCount}, input: ${u.input}, cached: ${u.cachedRead}, ` + `output: ${u.output}, cost: $${u.cost.toFixed(4)}`);
|
|
27934
27934
|
}
|
|
27935
27935
|
onFinishHandler(llm) {
|
|
27936
27936
|
return (evt) => {
|
|
@@ -58581,7 +58581,7 @@ ${event.systemPrompt}`);
|
|
|
58581
58581
|
======== Request Ended ========
|
|
58582
58582
|
`);
|
|
58583
58583
|
if (verbose) {
|
|
58584
|
-
usageMeter.printUsage();
|
|
58584
|
+
usageMeter.printUsage(customConsole);
|
|
58585
58585
|
}
|
|
58586
58586
|
break;
|
|
58587
58587
|
case "Usage" /* Usage */:
|