bitfab 0.28.4 → 0.28.6
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/{chunk-SAGZ674W.js → chunk-5E4BUIYA.js} +26 -2
- package/dist/chunk-5E4BUIYA.js.map +1 -0
- package/dist/{chunk-3F46BMPM.js → chunk-P4YXY7J4.js} +12 -5
- package/dist/chunk-P4YXY7J4.js.map +1 -0
- package/dist/index.cjs +34 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/node.cjs +34 -3
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-3E43G7OC.js → replay-IEE4RY57.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-3F46BMPM.js.map +0 -1
- package/dist/chunk-SAGZ674W.js.map +0 -1
- /package/dist/{replay-3E43G7OC.js.map → replay-IEE4RY57.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -624,11 +624,35 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
|
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
|
|
627
|
+
const replayResult = {
|
|
628
628
|
items: resultItems,
|
|
629
629
|
testRunId,
|
|
630
630
|
testRunUrl: `${serviceUrl}${testRunUrl}`
|
|
631
631
|
};
|
|
632
|
+
await writeReplayResultFile(replayResult);
|
|
633
|
+
return replayResult;
|
|
634
|
+
}
|
|
635
|
+
async function writeReplayResultFile(result) {
|
|
636
|
+
const resultPath = typeof process !== "undefined" ? process.env?.BITFAB_REPLAY_RESULT_PATH : void 0;
|
|
637
|
+
if (!resultPath) {
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
try {
|
|
641
|
+
const [{ dirname }, { mkdir, writeFile }] = await Promise.all([
|
|
642
|
+
import("path"),
|
|
643
|
+
import("fs/promises")
|
|
644
|
+
]);
|
|
645
|
+
await mkdir(dirname(resultPath), { recursive: true });
|
|
646
|
+
await writeFile(resultPath, `${JSON.stringify(result, null, 2)}
|
|
647
|
+
`);
|
|
648
|
+
} catch (err) {
|
|
649
|
+
try {
|
|
650
|
+
console.warn(
|
|
651
|
+
`Bitfab: failed to write replay result to BITFAB_REPLAY_RESULT_PATH (${resultPath}): ${err instanceof Error ? err.message : String(err)}`
|
|
652
|
+
);
|
|
653
|
+
} catch {
|
|
654
|
+
}
|
|
655
|
+
}
|
|
632
656
|
}
|
|
633
657
|
var BITFAB_PROGRESS_PREFIX;
|
|
634
658
|
var init_replay = __esm({
|
|
@@ -668,7 +692,7 @@ __export(index_exports, {
|
|
|
668
692
|
module.exports = __toCommonJS(index_exports);
|
|
669
693
|
|
|
670
694
|
// src/version.generated.ts
|
|
671
|
-
var __version__ = "0.28.
|
|
695
|
+
var __version__ = "0.28.6";
|
|
672
696
|
|
|
673
697
|
// src/constants.ts
|
|
674
698
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
@@ -1763,17 +1787,24 @@ function generateClientDefinitions(providers) {
|
|
|
1763
1787
|
for (const providerDef of providers) {
|
|
1764
1788
|
for (const model of providerDef.models) {
|
|
1765
1789
|
const clientName = getClientName(providerDef.provider, model.model);
|
|
1790
|
+
const temperatureOption = supportsTemperatureZero(
|
|
1791
|
+
providerDef.provider,
|
|
1792
|
+
model.model
|
|
1793
|
+
) ? "\n temperature 0" : "";
|
|
1766
1794
|
definitions.push(`client<llm> ${clientName} {
|
|
1767
1795
|
provider ${providerDef.provider}
|
|
1768
1796
|
options {
|
|
1769
1797
|
model "${model.model}"
|
|
1770
|
-
api_key env.${providerDef.apiKeyEnv}
|
|
1798
|
+
api_key env.${providerDef.apiKeyEnv}${temperatureOption}
|
|
1771
1799
|
}
|
|
1772
1800
|
}`);
|
|
1773
1801
|
}
|
|
1774
1802
|
}
|
|
1775
1803
|
return definitions.join("\n\n");
|
|
1776
1804
|
}
|
|
1805
|
+
function supportsTemperatureZero(provider, model) {
|
|
1806
|
+
return provider === "openai" && (model.startsWith("gpt-4.1") || model.startsWith("gpt-4o"));
|
|
1807
|
+
}
|
|
1777
1808
|
function withDefaultClients(bamlSource, providers) {
|
|
1778
1809
|
const hasDefaultClient = bamlSource.includes("client<llm> OpenAI_");
|
|
1779
1810
|
if (hasDefaultClient) {
|