@polka-codes/cli-shared 0.9.36 → 0.9.37
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 +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50160,6 +50160,7 @@ Request timeout after ${requestTimeoutSeconds} seconds. Canceling current reques
|
|
|
50160
50160
|
};
|
|
50161
50161
|
try {
|
|
50162
50162
|
resetTimeout();
|
|
50163
|
+
const usageMeterOnFinishHandler = this.config.usageMeter.onFinishHandler(this.ai);
|
|
50163
50164
|
const streamTextOptions = {
|
|
50164
50165
|
model: this.ai,
|
|
50165
50166
|
temperature: 0,
|
|
@@ -50178,7 +50179,10 @@ Request timeout after ${requestTimeoutSeconds} seconds. Canceling current reques
|
|
|
50178
50179
|
break;
|
|
50179
50180
|
}
|
|
50180
50181
|
},
|
|
50181
|
-
onFinish:
|
|
50182
|
+
onFinish: (evt) => {
|
|
50183
|
+
usageMeterOnFinishHandler(evt);
|
|
50184
|
+
this.#callback({ kind: "Usage" /* Usage */, agent: this, usage: evt.totalUsage });
|
|
50185
|
+
},
|
|
50182
50186
|
onError: async (error43) => {
|
|
50183
50187
|
console.error("Error in stream:", error43);
|
|
50184
50188
|
},
|