@probelabs/probe 0.6.0-rc136 → 0.6.0-rc138
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/build/agent/ProbeAgent.js +5 -2
- package/build/agent/fileSpanExporter.js +1 -3
- package/build/agent/index.js +204 -82311
- package/build/agent/telemetry.js +5 -10
- package/cjs/agent/ProbeAgent.cjs +353 -582
- package/cjs/agent/telemetry.cjs +15 -30
- package/cjs/index.cjs +363 -592
- package/package.json +1 -1
- package/src/agent/ProbeAgent.js +5 -2
- package/src/agent/fileSpanExporter.js +1 -3
- package/src/agent/telemetry.js +5 -10
|
@@ -1270,6 +1270,9 @@ When troubleshooting:
|
|
|
1270
1270
|
temperature: 0.3,
|
|
1271
1271
|
});
|
|
1272
1272
|
|
|
1273
|
+
// Get the promise reference BEFORE consuming stream (doesn't lock it)
|
|
1274
|
+
const usagePromise = result.usage;
|
|
1275
|
+
|
|
1273
1276
|
// Collect the streamed response - stream all content for now
|
|
1274
1277
|
for await (const delta of result.textStream) {
|
|
1275
1278
|
assistantResponseContent += delta;
|
|
@@ -1279,8 +1282,8 @@ When troubleshooting:
|
|
|
1279
1282
|
}
|
|
1280
1283
|
}
|
|
1281
1284
|
|
|
1282
|
-
// Record token usage
|
|
1283
|
-
const usage = await
|
|
1285
|
+
// Record token usage - await the promise AFTER stream is consumed
|
|
1286
|
+
const usage = await usagePromise;
|
|
1284
1287
|
if (usage) {
|
|
1285
1288
|
this.tokenCounter.recordUsage(usage, result.experimental_providerMetadata);
|
|
1286
1289
|
}
|