@bitfab/sdk 0.72.0 → 0.73.0
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/{http-C07Y93Ss.cjs → http-BIa41K6U.cjs} +2 -2
- package/dist/{http-C07Y93Ss.cjs.map → http-BIa41K6U.cjs.map} +1 -1
- package/dist/{http-7rcRBbK-.js → http-Be-Ou-NZ.js} +2 -2
- package/dist/{http-7rcRBbK-.js.map → http-Be-Ou-NZ.js.map} +1 -1
- package/dist/{index-DaZqdSDK.d.cts → index-BIED6Ww6.d.cts} +51 -4
- package/dist/{index-DaZqdSDK.d.ts → index-BIED6Ww6.d.ts} +51 -4
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/node.cjs +2 -2
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -2
- package/dist/registryCommand-BQcyBmhN.js.map +1 -1
- package/dist/{src-DRC6OVjp.cjs → src-DCcbWHsm.cjs} +18 -4
- package/dist/{src-DRC6OVjp.cjs.map → src-DCcbWHsm.cjs.map} +1 -1
- package/dist/{src-B9m0zAy1.js → src-GbrNtV2Q.js} +18 -4
- package/dist/{src-B9m0zAy1.js.map → src-GbrNtV2Q.js.map} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_bamlPeer = require("./bamlPeer-5Ohpq8q9.cjs");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-BIa41K6U.cjs");
|
|
3
3
|
const require_autoTrace = require("./autoTrace-DPWV1Xzr.cjs");
|
|
4
4
|
const require_optionalPeer = require("./optionalPeer-CUH756lt.cjs");
|
|
5
5
|
let superjson = require("superjson");
|
|
@@ -5615,6 +5615,16 @@ function extractPromptFromCollector(collector) {
|
|
|
5615
5615
|
return null;
|
|
5616
5616
|
}
|
|
5617
5617
|
}
|
|
5618
|
+
function reportedCostOf(call) {
|
|
5619
|
+
try {
|
|
5620
|
+
const response = call?.httpResponse?.body?.json();
|
|
5621
|
+
const usage = isPlainObject(response) ? response.usage : void 0;
|
|
5622
|
+
const cost = isPlainObject(usage) ? usage.cost : void 0;
|
|
5623
|
+
return typeof cost === "number" && Number.isFinite(cost) ? cost : null;
|
|
5624
|
+
} catch {
|
|
5625
|
+
return null;
|
|
5626
|
+
}
|
|
5627
|
+
}
|
|
5618
5628
|
function extractContextFromCollector(collector) {
|
|
5619
5629
|
try {
|
|
5620
5630
|
const c = collector;
|
|
@@ -5636,6 +5646,10 @@ function extractContextFromCollector(collector) {
|
|
|
5636
5646
|
const outputTokens = usage?.outputTokens ?? selectedCall?.usage?.outputTokens ?? null;
|
|
5637
5647
|
if (inputTokens !== null) context.inputTokens = inputTokens;
|
|
5638
5648
|
if (outputTokens !== null) context.outputTokens = outputTokens;
|
|
5649
|
+
const cachedInputTokens = usage?.cachedInputTokens ?? selectedCall?.usage?.cachedInputTokens ?? null;
|
|
5650
|
+
if (cachedInputTokens !== null) context.cachedInputTokens = cachedInputTokens;
|
|
5651
|
+
const costUsd = reportedCostOf(selectedCall);
|
|
5652
|
+
if (costUsd !== null) context.costUsd = costUsd;
|
|
5639
5653
|
const durationMs = c?.last?.timing?.durationMs ?? null;
|
|
5640
5654
|
if (durationMs !== null) context.durationMs = durationMs;
|
|
5641
5655
|
return Object.keys(context).length > 0 ? context : null;
|
|
@@ -7059,7 +7073,7 @@ var Bitfab = class {
|
|
|
7059
7073
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
7060
7074
|
} finally {
|
|
7061
7075
|
try {
|
|
7062
|
-
const { flushTraces } = await Promise.resolve().then(() => require("./http-
|
|
7076
|
+
const { flushTraces } = await Promise.resolve().then(() => require("./http-BIa41K6U.cjs")).then((n) => n.http_exports);
|
|
7063
7077
|
await flushTraces(3e4);
|
|
7064
7078
|
} finally {
|
|
7065
7079
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -7265,7 +7279,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
7265
7279
|
metadata: seedCase.metadata,
|
|
7266
7280
|
sessionId: seedCase.sessionId
|
|
7267
7281
|
}));
|
|
7268
|
-
const { flushTraces } = await Promise.resolve().then(() => require("./http-
|
|
7282
|
+
const { flushTraces } = await Promise.resolve().then(() => require("./http-BIa41K6U.cjs")).then((n) => n.http_exports);
|
|
7269
7283
|
await flushTraces(3e4);
|
|
7270
7284
|
return {
|
|
7271
7285
|
pipeline,
|
|
@@ -7515,4 +7529,4 @@ Object.defineProperty(exports, "serializeReplayResult", {
|
|
|
7515
7529
|
}
|
|
7516
7530
|
});
|
|
7517
7531
|
|
|
7518
|
-
//# sourceMappingURL=src-
|
|
7532
|
+
//# sourceMappingURL=src-DCcbWHsm.cjs.map
|