@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/cron.d.cts
CHANGED
package/dist/cron.d.ts
CHANGED
package/dist/cron.js
CHANGED
|
@@ -13682,6 +13682,9 @@ function resolveApiKey2(envVars) {
|
|
|
13682
13682
|
return void 0;
|
|
13683
13683
|
}
|
|
13684
13684
|
function selectTransport(profile, apiKey) {
|
|
13685
|
+
const transformCtx = { apiKey };
|
|
13686
|
+
const transformFetch = profile.transform?.fetch?.(transformCtx);
|
|
13687
|
+
const transformHeaders = profile.transform?.headers?.(transformCtx);
|
|
13685
13688
|
if (profile.apiMode === "chat_completions") {
|
|
13686
13689
|
if (profile.name === "ollama") {
|
|
13687
13690
|
const ollamaBase = process.env.OLLAMA_HOST ?? profile.baseUrl;
|
|
@@ -13698,6 +13701,7 @@ function selectTransport(profile, apiKey) {
|
|
|
13698
13701
|
}
|
|
13699
13702
|
const envOverride = resolveBaseUrlEnvOverride(profile.name);
|
|
13700
13703
|
if (envOverride !== void 0) opts.baseUrl = envOverride;
|
|
13704
|
+
if (transformFetch !== void 0) opts.fetch = transformFetch;
|
|
13701
13705
|
return new OpenAIClient(opts);
|
|
13702
13706
|
}
|
|
13703
13707
|
if (profile.apiMode === "anthropic_messages") {
|
|
@@ -13714,10 +13718,12 @@ function selectTransport(profile, apiKey) {
|
|
|
13714
13718
|
return new BedrockAnthropicClient(realKey !== void 0 ? { apiKey: realKey } : {});
|
|
13715
13719
|
}
|
|
13716
13720
|
if (profile.apiMode === "responses_api") {
|
|
13721
|
+
const mergedHeaders = profile.extraHeaders !== void 0 || transformHeaders !== void 0 ? { ...profile.extraHeaders, ...transformHeaders } : void 0;
|
|
13717
13722
|
return new ResponsesApiClient({
|
|
13718
13723
|
apiKey,
|
|
13719
13724
|
...profile.baseUrl !== void 0 ? { baseUrl: profile.baseUrl } : {},
|
|
13720
|
-
...
|
|
13725
|
+
...mergedHeaders !== void 0 ? { extraHeaders: mergedHeaders } : {},
|
|
13726
|
+
...transformFetch !== void 0 ? { fetch: transformFetch } : {},
|
|
13721
13727
|
providerName: profile.name
|
|
13722
13728
|
});
|
|
13723
13729
|
}
|