@bitfab/sdk 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
|
@@ -615,11 +615,35 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
|
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
|
|
618
|
+
const replayResult = {
|
|
619
619
|
items: resultItems,
|
|
620
620
|
testRunId,
|
|
621
621
|
testRunUrl: `${serviceUrl}${testRunUrl}`
|
|
622
622
|
};
|
|
623
|
+
await writeReplayResultFile(replayResult);
|
|
624
|
+
return replayResult;
|
|
625
|
+
}
|
|
626
|
+
async function writeReplayResultFile(result) {
|
|
627
|
+
const resultPath = typeof process !== "undefined" ? process.env?.BITFAB_REPLAY_RESULT_PATH : void 0;
|
|
628
|
+
if (!resultPath) {
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
try {
|
|
632
|
+
const [{ dirname }, { mkdir, writeFile }] = await Promise.all([
|
|
633
|
+
import("path"),
|
|
634
|
+
import("fs/promises")
|
|
635
|
+
]);
|
|
636
|
+
await mkdir(dirname(resultPath), { recursive: true });
|
|
637
|
+
await writeFile(resultPath, `${JSON.stringify(result, null, 2)}
|
|
638
|
+
`);
|
|
639
|
+
} catch (err) {
|
|
640
|
+
try {
|
|
641
|
+
console.warn(
|
|
642
|
+
`Bitfab: failed to write replay result to BITFAB_REPLAY_RESULT_PATH (${resultPath}): ${err instanceof Error ? err.message : String(err)}`
|
|
643
|
+
);
|
|
644
|
+
} catch {
|
|
645
|
+
}
|
|
646
|
+
}
|
|
623
647
|
}
|
|
624
648
|
var BITFAB_PROGRESS_PREFIX;
|
|
625
649
|
var init_replay = __esm({
|
|
@@ -659,7 +683,7 @@ __export(index_exports, {
|
|
|
659
683
|
module.exports = __toCommonJS(index_exports);
|
|
660
684
|
|
|
661
685
|
// src/version.generated.ts
|
|
662
|
-
var __version__ = "0.28.
|
|
686
|
+
var __version__ = "0.28.6";
|
|
663
687
|
|
|
664
688
|
// src/constants.ts
|
|
665
689
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
@@ -1754,17 +1778,24 @@ function generateClientDefinitions(providers) {
|
|
|
1754
1778
|
for (const providerDef of providers) {
|
|
1755
1779
|
for (const model of providerDef.models) {
|
|
1756
1780
|
const clientName = getClientName(providerDef.provider, model.model);
|
|
1781
|
+
const temperatureOption = supportsTemperatureZero(
|
|
1782
|
+
providerDef.provider,
|
|
1783
|
+
model.model
|
|
1784
|
+
) ? "\n temperature 0" : "";
|
|
1757
1785
|
definitions.push(`client<llm> ${clientName} {
|
|
1758
1786
|
provider ${providerDef.provider}
|
|
1759
1787
|
options {
|
|
1760
1788
|
model "${model.model}"
|
|
1761
|
-
api_key env.${providerDef.apiKeyEnv}
|
|
1789
|
+
api_key env.${providerDef.apiKeyEnv}${temperatureOption}
|
|
1762
1790
|
}
|
|
1763
1791
|
}`);
|
|
1764
1792
|
}
|
|
1765
1793
|
}
|
|
1766
1794
|
return definitions.join("\n\n");
|
|
1767
1795
|
}
|
|
1796
|
+
function supportsTemperatureZero(provider, model) {
|
|
1797
|
+
return provider === "openai" && (model.startsWith("gpt-4.1") || model.startsWith("gpt-4o"));
|
|
1798
|
+
}
|
|
1768
1799
|
function withDefaultClients(bamlSource, providers) {
|
|
1769
1800
|
const hasDefaultClient = bamlSource.includes("client<llm> OpenAI_");
|
|
1770
1801
|
if (hasDefaultClient) {
|