llm-strings 1.2.0 → 1.4.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/README.md +3 -14
- package/dist/ai-sdk.cjs +355 -10
- package/dist/ai-sdk.d.cts +5 -4
- package/dist/ai-sdk.d.ts +5 -4
- package/dist/ai-sdk.js +87 -9
- package/dist/{chunk-BCOUH7LH.js → chunk-5YTG2NRX.js} +1 -2
- package/dist/{chunk-W4NIQY7M.js → chunk-76EFNZCF.js} +317 -4
- package/dist/{chunk-2ARD4TFU.js → chunk-DPVT3FFP.js} +1 -2
- package/dist/{chunk-RPXK2A7O.js → chunk-OBLFZFNR.js} +3 -4
- package/dist/index.cjs +317 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -5
- package/dist/normalize.cjs +157 -4
- package/dist/normalize.d.cts +1 -1
- package/dist/normalize.d.ts +1 -1
- package/dist/normalize.js +2 -3
- package/dist/parse.cjs +27 -1
- package/dist/parse.d.cts +1 -1
- package/dist/parse.d.ts +1 -1
- package/dist/parse.js +2 -3
- package/dist/{provider-core-BiAl8MCV.d.cts → provider-core-B934MuhJ.d.cts} +2 -2
- package/dist/{provider-core-BiAl8MCV.d.ts → provider-core-B934MuhJ.d.ts} +2 -2
- package/dist/providers.cjs +451 -445
- package/dist/providers.d.cts +3 -8
- package/dist/providers.d.ts +3 -8
- package/dist/providers.js +135 -442
- package/dist/validate.cjs +317 -4
- package/dist/validate.js +4 -5
- package/package.json +1 -1
- package/dist/ai-sdk.cjs.map +0 -1
- package/dist/ai-sdk.js.map +0 -1
- package/dist/chunk-2ARD4TFU.js.map +0 -1
- package/dist/chunk-BCOUH7LH.js.map +0 -1
- package/dist/chunk-RPXK2A7O.js.map +0 -1
- package/dist/chunk-W4NIQY7M.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/normalize.cjs.map +0 -1
- package/dist/normalize.js.map +0 -1
- package/dist/parse.cjs.map +0 -1
- package/dist/parse.js.map +0 -1
- package/dist/providers.cjs.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/validate.cjs.map +0 -1
- package/dist/validate.js.map +0 -1
package/dist/ai-sdk.js
CHANGED
|
@@ -1,18 +1,49 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalize
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import
|
|
3
|
+
} from "./chunk-DPVT3FFP.js";
|
|
4
|
+
import {
|
|
5
|
+
parse
|
|
6
|
+
} from "./chunk-5YTG2NRX.js";
|
|
7
|
+
import "./chunk-76EFNZCF.js";
|
|
5
8
|
|
|
6
9
|
// src/ai-sdk.ts
|
|
7
10
|
var PROVIDER_OPTION_KEYS = {
|
|
8
11
|
openai: "openai",
|
|
12
|
+
azure: "azure",
|
|
9
13
|
anthropic: "anthropic",
|
|
10
14
|
google: "google",
|
|
15
|
+
"google-vertex": "vertex",
|
|
11
16
|
mistral: "mistral",
|
|
12
17
|
cohere: "cohere",
|
|
13
18
|
bedrock: "bedrock",
|
|
14
19
|
openrouter: "openrouter",
|
|
15
|
-
vercel: "gateway"
|
|
20
|
+
vercel: "gateway",
|
|
21
|
+
xai: "xai",
|
|
22
|
+
groq: "groq",
|
|
23
|
+
fal: "fal",
|
|
24
|
+
deepinfra: "deepinfra",
|
|
25
|
+
"black-forest-labs": "blackForestLabs",
|
|
26
|
+
together: "together",
|
|
27
|
+
fireworks: "fireworks",
|
|
28
|
+
deepseek: "deepseek",
|
|
29
|
+
moonshotai: "moonshotai",
|
|
30
|
+
perplexity: "perplexity",
|
|
31
|
+
alibaba: "alibaba",
|
|
32
|
+
cerebras: "cerebras",
|
|
33
|
+
replicate: "replicate",
|
|
34
|
+
prodia: "prodia",
|
|
35
|
+
luma: "luma",
|
|
36
|
+
bytedance: "bytedance",
|
|
37
|
+
kling: "kling",
|
|
38
|
+
elevenlabs: "elevenlabs",
|
|
39
|
+
assemblyai: "assemblyai",
|
|
40
|
+
deepgram: "deepgram",
|
|
41
|
+
gladia: "gladia",
|
|
42
|
+
lmnt: "lmnt",
|
|
43
|
+
hume: "hume",
|
|
44
|
+
revai: "revai",
|
|
45
|
+
baseten: "baseten",
|
|
46
|
+
huggingface: "huggingface"
|
|
16
47
|
};
|
|
17
48
|
var TRUE_VALUES = /* @__PURE__ */ new Set(["true", "1", "yes", "on"]);
|
|
18
49
|
var FALSE_VALUES = /* @__PURE__ */ new Set(["false", "0", "no", "off"]);
|
|
@@ -63,8 +94,7 @@ function mergeObjectOption(options, provider, key, value) {
|
|
|
63
94
|
setProviderOption(options, provider, key, parsed);
|
|
64
95
|
}
|
|
65
96
|
}
|
|
66
|
-
function addOpenAiOption(options, key, value) {
|
|
67
|
-
const target = "openai";
|
|
97
|
+
function addOpenAiOption(options, key, value, target = "openai") {
|
|
68
98
|
const mappings = {
|
|
69
99
|
reasoning_effort: "reasoningEffort",
|
|
70
100
|
max_completion_tokens: "maxCompletionTokens",
|
|
@@ -176,8 +206,7 @@ function addAnthropicOption(options, key, value) {
|
|
|
176
206
|
}
|
|
177
207
|
setProviderOption(options, target, optionKey, typedValue(value));
|
|
178
208
|
}
|
|
179
|
-
function addGoogleOption(options, key, value) {
|
|
180
|
-
const target = "google";
|
|
209
|
+
function addGoogleOption(options, key, value, target = "google") {
|
|
181
210
|
if (key === "thinking_budget" || key === "thinking_level" || key === "include_thoughts") {
|
|
182
211
|
const current = options[target]?.thinkingConfig;
|
|
183
212
|
const thinkingConfig = current && typeof current === "object" && !Array.isArray(current) ? { ...current } : {};
|
|
@@ -413,21 +442,71 @@ function addOpenRouterOption(options, key, value) {
|
|
|
413
442
|
setProviderOption(options, target, "user", value);
|
|
414
443
|
}
|
|
415
444
|
}
|
|
445
|
+
function addFlexibleProviderOption(options, target, key, value) {
|
|
446
|
+
setProviderOption(options, target, key, typedValue(value));
|
|
447
|
+
}
|
|
416
448
|
function addProviderSpecificOption(options, provider, key, value, includeGatewayOptions) {
|
|
417
449
|
if (provider === "vercel") {
|
|
418
450
|
if (includeGatewayOptions) addGatewayOption(options, key, value);
|
|
419
451
|
return;
|
|
420
452
|
}
|
|
421
453
|
if (provider === "openai") addOpenAiOption(options, key, value);
|
|
454
|
+
if (provider === "azure") addOpenAiOption(options, key, value, "azure");
|
|
422
455
|
if (provider === "anthropic") addAnthropicOption(options, key, value);
|
|
423
456
|
if (provider === "google") addGoogleOption(options, key, value);
|
|
457
|
+
if (provider === "google-vertex")
|
|
458
|
+
addGoogleOption(options, key, value, "vertex");
|
|
424
459
|
if (provider === "mistral") addMistralOption(options, key, value);
|
|
425
460
|
if (provider === "cohere") addCohereOption(options, key, value);
|
|
426
461
|
if (provider === "bedrock") addBedrockOption(options, key, value);
|
|
427
462
|
if (provider === "openrouter") addOpenRouterOption(options, key, value);
|
|
463
|
+
if (provider === "xai") addOpenAiOption(options, key, value, "xai");
|
|
464
|
+
if (provider === "groq") addOpenAiOption(options, key, value, "groq");
|
|
465
|
+
if (provider === "fal") addFlexibleProviderOption(options, "fal", key, value);
|
|
466
|
+
if (provider === "deepinfra")
|
|
467
|
+
addOpenAiOption(options, key, value, "deepinfra");
|
|
468
|
+
if (provider === "black-forest-labs")
|
|
469
|
+
addFlexibleProviderOption(options, "blackForestLabs", key, value);
|
|
470
|
+
if (provider === "together") addOpenAiOption(options, key, value, "together");
|
|
471
|
+
if (provider === "fireworks")
|
|
472
|
+
addOpenAiOption(options, key, value, "fireworks");
|
|
473
|
+
if (provider === "deepseek") addOpenAiOption(options, key, value, "deepseek");
|
|
474
|
+
if (provider === "moonshotai")
|
|
475
|
+
addOpenAiOption(options, key, value, "moonshotai");
|
|
476
|
+
if (provider === "perplexity")
|
|
477
|
+
addOpenAiOption(options, key, value, "perplexity");
|
|
478
|
+
if (provider === "alibaba") addOpenAiOption(options, key, value, "alibaba");
|
|
479
|
+
if (provider === "cerebras") addOpenAiOption(options, key, value, "cerebras");
|
|
480
|
+
if (provider === "replicate")
|
|
481
|
+
addFlexibleProviderOption(options, "replicate", key, value);
|
|
482
|
+
if (provider === "prodia")
|
|
483
|
+
addFlexibleProviderOption(options, "prodia", key, value);
|
|
484
|
+
if (provider === "luma")
|
|
485
|
+
addFlexibleProviderOption(options, "luma", key, value);
|
|
486
|
+
if (provider === "bytedance")
|
|
487
|
+
addFlexibleProviderOption(options, "bytedance", key, value);
|
|
488
|
+
if (provider === "kling")
|
|
489
|
+
addFlexibleProviderOption(options, "kling", key, value);
|
|
490
|
+
if (provider === "elevenlabs")
|
|
491
|
+
addFlexibleProviderOption(options, "elevenlabs", key, value);
|
|
492
|
+
if (provider === "assemblyai")
|
|
493
|
+
addFlexibleProviderOption(options, "assemblyai", key, value);
|
|
494
|
+
if (provider === "deepgram")
|
|
495
|
+
addFlexibleProviderOption(options, "deepgram", key, value);
|
|
496
|
+
if (provider === "gladia")
|
|
497
|
+
addFlexibleProviderOption(options, "gladia", key, value);
|
|
498
|
+
if (provider === "lmnt")
|
|
499
|
+
addFlexibleProviderOption(options, "lmnt", key, value);
|
|
500
|
+
if (provider === "hume")
|
|
501
|
+
addFlexibleProviderOption(options, "hume", key, value);
|
|
502
|
+
if (provider === "revai")
|
|
503
|
+
addFlexibleProviderOption(options, "revai", key, value);
|
|
504
|
+
if (provider === "baseten") addOpenAiOption(options, key, value, "baseten");
|
|
505
|
+
if (provider === "huggingface")
|
|
506
|
+
addOpenAiOption(options, key, value, "huggingface");
|
|
428
507
|
}
|
|
429
508
|
function createAiSdkProviderOptions(configOrResult, options = {}) {
|
|
430
|
-
const normalized = "changes" in configOrResult && "subProvider" in configOrResult ? configOrResult : normalize(configOrResult, options);
|
|
509
|
+
const normalized = typeof configOrResult === "string" ? normalize(parse(configOrResult), options) : "changes" in configOrResult && "subProvider" in configOrResult ? configOrResult : normalize(configOrResult, options);
|
|
431
510
|
const providerOptions = {};
|
|
432
511
|
if (!normalized.provider) {
|
|
433
512
|
return {
|
|
@@ -462,4 +541,3 @@ function createAiSdkProviderOptions(configOrResult, options = {}) {
|
|
|
462
541
|
export {
|
|
463
542
|
createAiSdkProviderOptions
|
|
464
543
|
};
|
|
465
|
-
//# sourceMappingURL=ai-sdk.js.map
|
|
@@ -4,8 +4,10 @@ function hasOwn(object, key) {
|
|
|
4
4
|
}
|
|
5
5
|
var HOST_ALIASES = {
|
|
6
6
|
openai: "api.openai.com",
|
|
7
|
+
azure: "models.inference.ai.azure.com",
|
|
7
8
|
anthropic: "api.anthropic.com",
|
|
8
9
|
google: "generativelanguage.googleapis.com",
|
|
10
|
+
"google-vertex": "aiplatform.googleapis.com",
|
|
9
11
|
aistudio: "generativelanguage.googleapis.com",
|
|
10
12
|
mistral: "api.mistral.ai",
|
|
11
13
|
cohere: "api.cohere.com",
|
|
@@ -15,8 +17,16 @@ var HOST_ALIASES = {
|
|
|
15
17
|
alibaba: "dashscope-intl.aliyuncs.com",
|
|
16
18
|
alibabacloud: "dashscope-intl.aliyuncs.com",
|
|
17
19
|
dashscope: "dashscope-intl.aliyuncs.com",
|
|
20
|
+
groq: "api.groq.com",
|
|
21
|
+
fal: "fal.run",
|
|
18
22
|
fireworks: "api.fireworks.ai",
|
|
19
23
|
fireworksai: "api.fireworks.ai",
|
|
24
|
+
"black-forest-labs": "api.bfl.ai",
|
|
25
|
+
bfl: "api.bfl.ai",
|
|
26
|
+
deepseek: "api.deepseek.com",
|
|
27
|
+
moonshotai: "api.moonshot.ai",
|
|
28
|
+
moonshot: "api.moonshot.ai",
|
|
29
|
+
perplexity: "api.perplexity.ai",
|
|
20
30
|
venice: "api.venice.ai",
|
|
21
31
|
parasail: "api.parasail.io",
|
|
22
32
|
deepinfra: "api.deepinfra.com",
|
|
@@ -25,6 +35,23 @@ var HOST_ALIASES = {
|
|
|
25
35
|
novitaai: "api.novita.ai",
|
|
26
36
|
grok: "api.x.ai",
|
|
27
37
|
xai: "api.x.ai",
|
|
38
|
+
together: "api.together.xyz",
|
|
39
|
+
togetherai: "api.together.xyz",
|
|
40
|
+
cerebras: "api.cerebras.ai",
|
|
41
|
+
replicate: "api.replicate.com",
|
|
42
|
+
prodia: "api.prodia.com",
|
|
43
|
+
luma: "api.lumalabs.ai",
|
|
44
|
+
bytedance: "ark.cn-beijing.volces.com",
|
|
45
|
+
kling: "api.klingai.com",
|
|
46
|
+
elevenlabs: "api.elevenlabs.io",
|
|
47
|
+
assemblyai: "api.assemblyai.com",
|
|
48
|
+
deepgram: "api.deepgram.com",
|
|
49
|
+
gladia: "api.gladia.io",
|
|
50
|
+
lmnt: "api.lmnt.com",
|
|
51
|
+
hume: "api.hume.ai",
|
|
52
|
+
revai: "api.rev.ai",
|
|
53
|
+
baseten: "api.baseten.co",
|
|
54
|
+
huggingface: "api-inference.huggingface.co",
|
|
28
55
|
wandb: "api.inference.wandb.ai",
|
|
29
56
|
weightsandbiases: "api.inference.wandb.ai",
|
|
30
57
|
baidu: "qianfan.baidubce.com",
|
|
@@ -33,6 +60,18 @@ var HOST_ALIASES = {
|
|
|
33
60
|
xiaomi: "api.xiaomimimo.com",
|
|
34
61
|
minimax: "api.minimax.io"
|
|
35
62
|
};
|
|
63
|
+
var HOST_ALIAS_PROVIDERS = {
|
|
64
|
+
aistudio: "google",
|
|
65
|
+
vertex: "google-vertex",
|
|
66
|
+
grok: "xai",
|
|
67
|
+
bfl: "black-forest-labs",
|
|
68
|
+
moonshot: "moonshotai",
|
|
69
|
+
alibaba: "alibaba",
|
|
70
|
+
alibabacloud: "alibaba",
|
|
71
|
+
dashscope: "alibaba",
|
|
72
|
+
togetherai: "together",
|
|
73
|
+
fireworksai: "fireworks"
|
|
74
|
+
};
|
|
36
75
|
function readProcessEnv() {
|
|
37
76
|
return typeof process !== "undefined" && process.env ? process.env : {};
|
|
38
77
|
}
|
|
@@ -69,6 +108,9 @@ function providerFromHostAlias(alias) {
|
|
|
69
108
|
if (hasOwn(PROVIDER_PARAMS, normalizedAlias)) {
|
|
70
109
|
return normalizedAlias;
|
|
71
110
|
}
|
|
111
|
+
if (hasOwn(HOST_ALIAS_PROVIDERS, normalizedAlias)) {
|
|
112
|
+
return HOST_ALIAS_PROVIDERS[normalizedAlias];
|
|
113
|
+
}
|
|
72
114
|
return void 0;
|
|
73
115
|
}
|
|
74
116
|
function detectProvider(host) {
|
|
@@ -76,6 +118,34 @@ function detectProvider(host) {
|
|
|
76
118
|
if (host.includes("openrouter")) return "openrouter";
|
|
77
119
|
if (host.includes("gateway.ai.vercel")) return "vercel";
|
|
78
120
|
if (host.includes("amazonaws") || host.includes("bedrock")) return "bedrock";
|
|
121
|
+
if (host.includes("aiplatform.googleapis")) return "google-vertex";
|
|
122
|
+
if (host.includes("api.x.ai")) return "xai";
|
|
123
|
+
if (host.includes("groq")) return "groq";
|
|
124
|
+
if (host.includes("fal.run") || host.includes("fal.ai")) return "fal";
|
|
125
|
+
if (host.includes("deepinfra")) return "deepinfra";
|
|
126
|
+
if (host.includes("bfl.ai")) return "black-forest-labs";
|
|
127
|
+
if (host.includes("together")) return "together";
|
|
128
|
+
if (host.includes("fireworks")) return "fireworks";
|
|
129
|
+
if (host.includes("deepseek")) return "deepseek";
|
|
130
|
+
if (host.includes("moonshot")) return "moonshotai";
|
|
131
|
+
if (host.includes("perplexity")) return "perplexity";
|
|
132
|
+
if (host.includes("dashscope") || host.includes("aliyuncs")) return "alibaba";
|
|
133
|
+
if (host.includes("cerebras")) return "cerebras";
|
|
134
|
+
if (host.includes("replicate")) return "replicate";
|
|
135
|
+
if (host.includes("prodia")) return "prodia";
|
|
136
|
+
if (host.includes("lumalabs") || host.includes("luma")) return "luma";
|
|
137
|
+
if (host.includes("volces") || host.includes("bytedance")) return "bytedance";
|
|
138
|
+
if (host.includes("kling")) return "kling";
|
|
139
|
+
if (host.includes("elevenlabs")) return "elevenlabs";
|
|
140
|
+
if (host.includes("assemblyai")) return "assemblyai";
|
|
141
|
+
if (host.includes("deepgram")) return "deepgram";
|
|
142
|
+
if (host.includes("gladia")) return "gladia";
|
|
143
|
+
if (host.includes("lmnt")) return "lmnt";
|
|
144
|
+
if (host.includes("hume")) return "hume";
|
|
145
|
+
if (host.includes("rev.ai")) return "revai";
|
|
146
|
+
if (host.includes("baseten")) return "baseten";
|
|
147
|
+
if (host.includes("huggingface")) return "huggingface";
|
|
148
|
+
if (host.includes("azure")) return "azure";
|
|
79
149
|
if (host.includes("openai")) return "openai";
|
|
80
150
|
if (host.includes("anthropic") || host.includes("claude")) return "anthropic";
|
|
81
151
|
if (host.includes("googleapis") || host.includes("google")) return "google";
|
|
@@ -130,6 +200,33 @@ var ALIASES = {
|
|
|
130
200
|
cachePoint: "cache",
|
|
131
201
|
cache_point: "cache"
|
|
132
202
|
};
|
|
203
|
+
var OPENAI_COMPATIBLE_PARAMS = {
|
|
204
|
+
temperature: "temperature",
|
|
205
|
+
max_tokens: "max_tokens",
|
|
206
|
+
top_p: "top_p",
|
|
207
|
+
top_k: "top_k",
|
|
208
|
+
frequency_penalty: "frequency_penalty",
|
|
209
|
+
presence_penalty: "presence_penalty",
|
|
210
|
+
stop: "stop",
|
|
211
|
+
n: "n",
|
|
212
|
+
seed: "seed",
|
|
213
|
+
stream: "stream",
|
|
214
|
+
effort: "reasoning_effort"
|
|
215
|
+
};
|
|
216
|
+
var GOOGLE_COMPATIBLE_PARAMS = {
|
|
217
|
+
temperature: "temperature",
|
|
218
|
+
max_tokens: "maxOutputTokens",
|
|
219
|
+
top_p: "topP",
|
|
220
|
+
top_k: "topK",
|
|
221
|
+
frequency_penalty: "frequencyPenalty",
|
|
222
|
+
presence_penalty: "presencePenalty",
|
|
223
|
+
stop: "stopSequences",
|
|
224
|
+
n: "candidateCount",
|
|
225
|
+
stream: "stream",
|
|
226
|
+
seed: "seed",
|
|
227
|
+
responseMimeType: "responseMimeType",
|
|
228
|
+
responseSchema: "responseSchema"
|
|
229
|
+
};
|
|
133
230
|
var PROVIDER_PARAMS = {
|
|
134
231
|
openai: {
|
|
135
232
|
temperature: "temperature",
|
|
@@ -143,6 +240,7 @@ var PROVIDER_PARAMS = {
|
|
|
143
240
|
stream: "stream",
|
|
144
241
|
effort: "reasoning_effort"
|
|
145
242
|
},
|
|
243
|
+
azure: OPENAI_COMPATIBLE_PARAMS,
|
|
146
244
|
anthropic: {
|
|
147
245
|
temperature: "temperature",
|
|
148
246
|
max_tokens: "max_tokens",
|
|
@@ -168,6 +266,7 @@ var PROVIDER_PARAMS = {
|
|
|
168
266
|
responseMimeType: "responseMimeType",
|
|
169
267
|
responseSchema: "responseSchema"
|
|
170
268
|
},
|
|
269
|
+
"google-vertex": GOOGLE_COMPATIBLE_PARAMS,
|
|
171
270
|
mistral: {
|
|
172
271
|
temperature: "temperature",
|
|
173
272
|
max_tokens: "max_tokens",
|
|
@@ -231,8 +330,139 @@ var PROVIDER_PARAMS = {
|
|
|
231
330
|
seed: "seed",
|
|
232
331
|
stream: "stream",
|
|
233
332
|
effort: "reasoning_effort"
|
|
333
|
+
},
|
|
334
|
+
xai: OPENAI_COMPATIBLE_PARAMS,
|
|
335
|
+
groq: OPENAI_COMPATIBLE_PARAMS,
|
|
336
|
+
fal: {},
|
|
337
|
+
deepinfra: OPENAI_COMPATIBLE_PARAMS,
|
|
338
|
+
"black-forest-labs": {},
|
|
339
|
+
together: OPENAI_COMPATIBLE_PARAMS,
|
|
340
|
+
fireworks: OPENAI_COMPATIBLE_PARAMS,
|
|
341
|
+
deepseek: OPENAI_COMPATIBLE_PARAMS,
|
|
342
|
+
moonshotai: OPENAI_COMPATIBLE_PARAMS,
|
|
343
|
+
perplexity: OPENAI_COMPATIBLE_PARAMS,
|
|
344
|
+
alibaba: OPENAI_COMPATIBLE_PARAMS,
|
|
345
|
+
cerebras: OPENAI_COMPATIBLE_PARAMS,
|
|
346
|
+
replicate: {},
|
|
347
|
+
prodia: {},
|
|
348
|
+
luma: {},
|
|
349
|
+
bytedance: {},
|
|
350
|
+
kling: {},
|
|
351
|
+
elevenlabs: {},
|
|
352
|
+
assemblyai: {},
|
|
353
|
+
deepgram: {},
|
|
354
|
+
gladia: {},
|
|
355
|
+
lmnt: {},
|
|
356
|
+
hume: {},
|
|
357
|
+
revai: {},
|
|
358
|
+
baseten: OPENAI_COMPATIBLE_PARAMS,
|
|
359
|
+
huggingface: OPENAI_COMPATIBLE_PARAMS
|
|
360
|
+
};
|
|
361
|
+
var OPENAI_COMPATIBLE_PARAM_SPECS = {
|
|
362
|
+
temperature: {
|
|
363
|
+
type: "number",
|
|
364
|
+
min: 0,
|
|
365
|
+
max: 2,
|
|
366
|
+
default: 0.7,
|
|
367
|
+
description: "Controls randomness"
|
|
368
|
+
},
|
|
369
|
+
max_tokens: {
|
|
370
|
+
type: "number",
|
|
371
|
+
min: 1,
|
|
372
|
+
default: 4096,
|
|
373
|
+
description: "Maximum output tokens"
|
|
374
|
+
},
|
|
375
|
+
top_p: {
|
|
376
|
+
type: "number",
|
|
377
|
+
min: 0,
|
|
378
|
+
max: 1,
|
|
379
|
+
default: 1,
|
|
380
|
+
description: "Nucleus sampling"
|
|
381
|
+
},
|
|
382
|
+
top_k: {
|
|
383
|
+
type: "number",
|
|
384
|
+
min: 0,
|
|
385
|
+
default: 40,
|
|
386
|
+
description: "Top-K sampling"
|
|
387
|
+
},
|
|
388
|
+
frequency_penalty: {
|
|
389
|
+
type: "number",
|
|
390
|
+
min: -2,
|
|
391
|
+
max: 2,
|
|
392
|
+
default: 0,
|
|
393
|
+
description: "Penalize frequent tokens"
|
|
394
|
+
},
|
|
395
|
+
presence_penalty: {
|
|
396
|
+
type: "number",
|
|
397
|
+
min: -2,
|
|
398
|
+
max: 2,
|
|
399
|
+
default: 0,
|
|
400
|
+
description: "Penalize repeated topics"
|
|
401
|
+
},
|
|
402
|
+
stop: { type: "string", description: "Stop sequences" },
|
|
403
|
+
n: { type: "number", min: 1, default: 1, description: "Completions count" },
|
|
404
|
+
seed: { type: "number", description: "Random seed" },
|
|
405
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
406
|
+
reasoning_effort: {
|
|
407
|
+
type: "string",
|
|
408
|
+
values: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
409
|
+
default: "medium",
|
|
410
|
+
description: "Reasoning effort"
|
|
234
411
|
}
|
|
235
412
|
};
|
|
413
|
+
var GOOGLE_COMPATIBLE_PARAM_SPECS = {
|
|
414
|
+
temperature: {
|
|
415
|
+
type: "number",
|
|
416
|
+
min: 0,
|
|
417
|
+
max: 2,
|
|
418
|
+
default: 0.7,
|
|
419
|
+
description: "Controls randomness"
|
|
420
|
+
},
|
|
421
|
+
maxOutputTokens: {
|
|
422
|
+
type: "number",
|
|
423
|
+
min: 1,
|
|
424
|
+
default: 4096,
|
|
425
|
+
description: "Maximum output tokens"
|
|
426
|
+
},
|
|
427
|
+
topP: {
|
|
428
|
+
type: "number",
|
|
429
|
+
min: 0,
|
|
430
|
+
max: 1,
|
|
431
|
+
default: 1,
|
|
432
|
+
description: "Nucleus sampling"
|
|
433
|
+
},
|
|
434
|
+
topK: {
|
|
435
|
+
type: "number",
|
|
436
|
+
min: 0,
|
|
437
|
+
default: 40,
|
|
438
|
+
description: "Top-K sampling"
|
|
439
|
+
},
|
|
440
|
+
frequencyPenalty: {
|
|
441
|
+
type: "number",
|
|
442
|
+
min: -2,
|
|
443
|
+
max: 2,
|
|
444
|
+
default: 0,
|
|
445
|
+
description: "Penalize frequent tokens"
|
|
446
|
+
},
|
|
447
|
+
presencePenalty: {
|
|
448
|
+
type: "number",
|
|
449
|
+
min: -2,
|
|
450
|
+
max: 2,
|
|
451
|
+
default: 0,
|
|
452
|
+
description: "Penalize repeated topics"
|
|
453
|
+
},
|
|
454
|
+
stopSequences: { type: "string", description: "Stop sequences" },
|
|
455
|
+
candidateCount: {
|
|
456
|
+
type: "number",
|
|
457
|
+
min: 1,
|
|
458
|
+
default: 1,
|
|
459
|
+
description: "Candidate count"
|
|
460
|
+
},
|
|
461
|
+
stream: { type: "boolean", default: false, description: "Stream response" },
|
|
462
|
+
seed: { type: "number", description: "Random seed" },
|
|
463
|
+
responseMimeType: { type: "string", description: "Response MIME type" },
|
|
464
|
+
responseSchema: { type: "string", description: "Response schema" }
|
|
465
|
+
};
|
|
236
466
|
var PARAM_SPECS = {
|
|
237
467
|
openai: {
|
|
238
468
|
temperature: {
|
|
@@ -280,6 +510,7 @@ var PARAM_SPECS = {
|
|
|
280
510
|
description: "Reasoning effort"
|
|
281
511
|
}
|
|
282
512
|
},
|
|
513
|
+
azure: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
283
514
|
anthropic: {
|
|
284
515
|
temperature: {
|
|
285
516
|
type: "number",
|
|
@@ -381,6 +612,7 @@ var PARAM_SPECS = {
|
|
|
381
612
|
responseMimeType: { type: "string", description: "Response MIME type" },
|
|
382
613
|
responseSchema: { type: "string", description: "Response schema" }
|
|
383
614
|
},
|
|
615
|
+
"google-vertex": GOOGLE_COMPATIBLE_PARAM_SPECS,
|
|
384
616
|
mistral: {
|
|
385
617
|
temperature: {
|
|
386
618
|
type: "number",
|
|
@@ -626,7 +858,33 @@ var PARAM_SPECS = {
|
|
|
626
858
|
default: "medium",
|
|
627
859
|
description: "Reasoning effort"
|
|
628
860
|
}
|
|
629
|
-
}
|
|
861
|
+
},
|
|
862
|
+
xai: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
863
|
+
groq: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
864
|
+
fal: {},
|
|
865
|
+
deepinfra: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
866
|
+
"black-forest-labs": {},
|
|
867
|
+
together: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
868
|
+
fireworks: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
869
|
+
deepseek: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
870
|
+
moonshotai: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
871
|
+
perplexity: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
872
|
+
alibaba: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
873
|
+
cerebras: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
874
|
+
replicate: {},
|
|
875
|
+
prodia: {},
|
|
876
|
+
luma: {},
|
|
877
|
+
bytedance: {},
|
|
878
|
+
kling: {},
|
|
879
|
+
elevenlabs: {},
|
|
880
|
+
assemblyai: {},
|
|
881
|
+
deepgram: {},
|
|
882
|
+
gladia: {},
|
|
883
|
+
lmnt: {},
|
|
884
|
+
hume: {},
|
|
885
|
+
revai: {},
|
|
886
|
+
baseten: OPENAI_COMPATIBLE_PARAM_SPECS,
|
|
887
|
+
huggingface: OPENAI_COMPATIBLE_PARAM_SPECS
|
|
630
888
|
};
|
|
631
889
|
function isReasoningModel(model) {
|
|
632
890
|
const name = model.includes("/") ? model.split("/").pop() : model;
|
|
@@ -683,28 +941,84 @@ function bedrockSupportsCaching(model) {
|
|
|
683
941
|
var CACHE_VALUES = {
|
|
684
942
|
openai: void 0,
|
|
685
943
|
// OpenAI auto-caches; no explicit param
|
|
944
|
+
azure: void 0,
|
|
686
945
|
anthropic: "ephemeral",
|
|
687
946
|
google: void 0,
|
|
688
947
|
// Google uses explicit caching API, not a param
|
|
948
|
+
"google-vertex": void 0,
|
|
689
949
|
mistral: void 0,
|
|
690
950
|
cohere: void 0,
|
|
691
951
|
bedrock: "ephemeral",
|
|
692
952
|
// Supported for Claude models on Bedrock
|
|
693
953
|
openrouter: void 0,
|
|
694
954
|
// Depends on underlying provider
|
|
695
|
-
vercel: void 0
|
|
955
|
+
vercel: void 0,
|
|
696
956
|
// Depends on underlying provider
|
|
957
|
+
xai: void 0,
|
|
958
|
+
groq: void 0,
|
|
959
|
+
fal: void 0,
|
|
960
|
+
deepinfra: void 0,
|
|
961
|
+
"black-forest-labs": void 0,
|
|
962
|
+
together: void 0,
|
|
963
|
+
fireworks: void 0,
|
|
964
|
+
deepseek: void 0,
|
|
965
|
+
moonshotai: void 0,
|
|
966
|
+
perplexity: void 0,
|
|
967
|
+
alibaba: void 0,
|
|
968
|
+
cerebras: void 0,
|
|
969
|
+
replicate: void 0,
|
|
970
|
+
prodia: void 0,
|
|
971
|
+
luma: void 0,
|
|
972
|
+
bytedance: void 0,
|
|
973
|
+
kling: void 0,
|
|
974
|
+
elevenlabs: void 0,
|
|
975
|
+
assemblyai: void 0,
|
|
976
|
+
deepgram: void 0,
|
|
977
|
+
gladia: void 0,
|
|
978
|
+
lmnt: void 0,
|
|
979
|
+
hume: void 0,
|
|
980
|
+
revai: void 0,
|
|
981
|
+
baseten: void 0,
|
|
982
|
+
huggingface: void 0
|
|
697
983
|
};
|
|
698
984
|
var CACHE_TTLS = {
|
|
699
985
|
openai: void 0,
|
|
986
|
+
azure: void 0,
|
|
700
987
|
anthropic: ["5m", "1h"],
|
|
701
988
|
google: void 0,
|
|
989
|
+
"google-vertex": void 0,
|
|
702
990
|
mistral: void 0,
|
|
703
991
|
cohere: void 0,
|
|
704
992
|
bedrock: ["5m", "1h"],
|
|
705
993
|
// Claude on Bedrock uses same TTLs as direct Anthropic
|
|
706
994
|
openrouter: void 0,
|
|
707
|
-
vercel: void 0
|
|
995
|
+
vercel: void 0,
|
|
996
|
+
xai: void 0,
|
|
997
|
+
groq: void 0,
|
|
998
|
+
fal: void 0,
|
|
999
|
+
deepinfra: void 0,
|
|
1000
|
+
"black-forest-labs": void 0,
|
|
1001
|
+
together: void 0,
|
|
1002
|
+
fireworks: void 0,
|
|
1003
|
+
deepseek: void 0,
|
|
1004
|
+
moonshotai: void 0,
|
|
1005
|
+
perplexity: void 0,
|
|
1006
|
+
alibaba: void 0,
|
|
1007
|
+
cerebras: void 0,
|
|
1008
|
+
replicate: void 0,
|
|
1009
|
+
prodia: void 0,
|
|
1010
|
+
luma: void 0,
|
|
1011
|
+
bytedance: void 0,
|
|
1012
|
+
kling: void 0,
|
|
1013
|
+
elevenlabs: void 0,
|
|
1014
|
+
assemblyai: void 0,
|
|
1015
|
+
deepgram: void 0,
|
|
1016
|
+
gladia: void 0,
|
|
1017
|
+
lmnt: void 0,
|
|
1018
|
+
hume: void 0,
|
|
1019
|
+
revai: void 0,
|
|
1020
|
+
baseten: void 0,
|
|
1021
|
+
huggingface: void 0
|
|
708
1022
|
};
|
|
709
1023
|
var DURATION_RE = /^\d+[mh]$/;
|
|
710
1024
|
|
|
@@ -727,4 +1041,3 @@ export {
|
|
|
727
1041
|
CACHE_TTLS,
|
|
728
1042
|
DURATION_RE
|
|
729
1043
|
};
|
|
730
|
-
//# sourceMappingURL=chunk-W4NIQY7M.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isGatewayProvider,
|
|
12
12
|
isReasoningModel,
|
|
13
13
|
providerFromHostAlias
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-76EFNZCF.js";
|
|
15
15
|
|
|
16
16
|
// src/normalize.ts
|
|
17
17
|
function normalize(config, options = {}) {
|
|
@@ -114,4 +114,3 @@ function normalize(config, options = {}) {
|
|
|
114
114
|
export {
|
|
115
115
|
normalize
|
|
116
116
|
};
|
|
117
|
-
//# sourceMappingURL=chunk-2ARD4TFU.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalize
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DPVT3FFP.js";
|
|
4
4
|
import {
|
|
5
5
|
parse
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5YTG2NRX.js";
|
|
7
7
|
import {
|
|
8
8
|
PARAM_SPECS,
|
|
9
9
|
PROVIDER_PARAMS,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
canHostOpenAIModels,
|
|
13
13
|
detectBedrockModelFamily,
|
|
14
14
|
isReasoningModel
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-76EFNZCF.js";
|
|
16
16
|
|
|
17
17
|
// src/validate.ts
|
|
18
18
|
function buildReverseParamMap(provider) {
|
|
@@ -173,4 +173,3 @@ function validate(connectionString, options = {}) {
|
|
|
173
173
|
export {
|
|
174
174
|
validate
|
|
175
175
|
};
|
|
176
|
-
//# sourceMappingURL=chunk-RPXK2A7O.js.map
|