@theokit/sdk 4.9.1 → 4.10.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/{cron-D_0p_gXd.d.ts → cron-BF_AI5NP.d.ts} +31 -0
- package/dist/{cron-26WH1n7o.d.cts → cron-DXEhagMa.d.cts} +31 -0
- package/dist/cron.cjs +7 -1
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +1 -1
- package/dist/cron.d.ts +1 -1
- package/dist/cron.js +7 -1
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +7 -1
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +7 -1
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +7 -1
- 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 +7 -1
- package/dist/index.js.map +1 -1
- package/dist/types/provider-profile.d.ts +31 -0
- package/package.json +1 -1
package/dist/eval.cjs
CHANGED
|
@@ -13680,6 +13680,9 @@ function resolveApiKey2(envVars) {
|
|
|
13680
13680
|
return void 0;
|
|
13681
13681
|
}
|
|
13682
13682
|
function selectTransport(profile, apiKey) {
|
|
13683
|
+
const transformCtx = { apiKey };
|
|
13684
|
+
const transformFetch = profile.transform?.fetch?.(transformCtx);
|
|
13685
|
+
const transformHeaders = profile.transform?.headers?.(transformCtx);
|
|
13683
13686
|
if (profile.apiMode === "chat_completions") {
|
|
13684
13687
|
if (profile.name === "ollama") {
|
|
13685
13688
|
const ollamaBase = process.env.OLLAMA_HOST ?? profile.baseUrl;
|
|
@@ -13696,6 +13699,7 @@ function selectTransport(profile, apiKey) {
|
|
|
13696
13699
|
}
|
|
13697
13700
|
const envOverride = resolveBaseUrlEnvOverride(profile.name);
|
|
13698
13701
|
if (envOverride !== void 0) opts.baseUrl = envOverride;
|
|
13702
|
+
if (transformFetch !== void 0) opts.fetch = transformFetch;
|
|
13699
13703
|
return new OpenAIClient(opts);
|
|
13700
13704
|
}
|
|
13701
13705
|
if (profile.apiMode === "anthropic_messages") {
|
|
@@ -13712,10 +13716,12 @@ function selectTransport(profile, apiKey) {
|
|
|
13712
13716
|
return new BedrockAnthropicClient(realKey !== void 0 ? { apiKey: realKey } : {});
|
|
13713
13717
|
}
|
|
13714
13718
|
if (profile.apiMode === "responses_api") {
|
|
13719
|
+
const mergedHeaders = profile.extraHeaders !== void 0 || transformHeaders !== void 0 ? { ...profile.extraHeaders, ...transformHeaders } : void 0;
|
|
13715
13720
|
return new ResponsesApiClient({
|
|
13716
13721
|
apiKey,
|
|
13717
13722
|
...profile.baseUrl !== void 0 ? { baseUrl: profile.baseUrl } : {},
|
|
13718
|
-
...
|
|
13723
|
+
...mergedHeaders !== void 0 ? { extraHeaders: mergedHeaders } : {},
|
|
13724
|
+
...transformFetch !== void 0 ? { fetch: transformFetch } : {},
|
|
13719
13725
|
providerName: profile.name
|
|
13720
13726
|
});
|
|
13721
13727
|
}
|