vibezcheck 0.5.3 → 0.5.4
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/ai-sdk/index.js +147 -24
- package/dist/ai-sdk/index.js.map +1 -1
- package/dist/ai-sdk/index.mjs +147 -24
- package/dist/ai-sdk/index.mjs.map +1 -1
- package/dist/ai-sdk/middleware.js +142 -23
- package/dist/ai-sdk/middleware.js.map +1 -1
- package/dist/ai-sdk/middleware.mjs +142 -23
- package/dist/ai-sdk/middleware.mjs.map +1 -1
- package/dist/billing/index.js +142 -23
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +142 -23
- package/dist/billing/index.mjs.map +1 -1
- package/dist/cli/index.js +44 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +44 -22
- package/dist/cli/index.mjs.map +1 -1
- package/dist/compat/stripe-meter.js +142 -23
- package/dist/compat/stripe-meter.js.map +1 -1
- package/dist/compat/stripe-meter.mjs +142 -23
- package/dist/compat/stripe-meter.mjs.map +1 -1
- package/dist/compat/stripe-provider.js +147 -24
- package/dist/compat/stripe-provider.js.map +1 -1
- package/dist/compat/stripe-provider.mjs +147 -24
- package/dist/compat/stripe-provider.mjs.map +1 -1
- package/dist/compat/token-meter.js +93 -10
- package/dist/compat/token-meter.js.map +1 -1
- package/dist/compat/token-meter.mjs +93 -10
- package/dist/compat/token-meter.mjs.map +1 -1
- package/dist/index.js +147 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +147 -24
- package/dist/index.mjs.map +1 -1
- package/dist/meter/index.js +93 -10
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.mjs +93 -10
- package/dist/meter/index.mjs.map +1 -1
- package/dist/pricing/index.js +32 -1
- package/dist/pricing/index.js.map +1 -1
- package/dist/pricing/index.mjs +32 -1
- package/dist/pricing/index.mjs.map +1 -1
- package/dist/react/index.d.mts +5 -3
- package/dist/react/index.d.ts +5 -3
- package/dist/react/index.js +301 -193
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +301 -193
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/ai-sdk/index.js
CHANGED
|
@@ -309,12 +309,38 @@ function extractOpenAIResponseUsage(response) {
|
|
|
309
309
|
function inspectOpenAIStreamChunk(chunk) {
|
|
310
310
|
if (!chunk || typeof chunk !== "object") return {};
|
|
311
311
|
const model = chunk.model;
|
|
312
|
-
const rawUsage = chunk.usage || chunk.token_usage || chunk.x_groq?.usage || chunk.usageMetadata;
|
|
312
|
+
const rawUsage = (chunk.type === "finish" ? chunk.usage : null) || chunk.usage || chunk.token_usage || chunk.x_groq?.usage || chunk.usageMetadata;
|
|
313
313
|
if (rawUsage) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
314
|
+
let inputTokens = 0;
|
|
315
|
+
let outputTokens = 0;
|
|
316
|
+
let reasoningTokens = 0;
|
|
317
|
+
let cachedTokens = 0;
|
|
318
|
+
if (typeof rawUsage.inputTokens === "object" && rawUsage.inputTokens !== null) {
|
|
319
|
+
inputTokens = rawUsage.inputTokens.total ?? rawUsage.inputTokens.noCache ?? 0;
|
|
320
|
+
cachedTokens = rawUsage.inputTokens.cacheRead ?? 0;
|
|
321
|
+
} else if (typeof rawUsage.promptTokens === "number") {
|
|
322
|
+
inputTokens = rawUsage.promptTokens;
|
|
323
|
+
} else if (typeof rawUsage.inputTokens === "number") {
|
|
324
|
+
inputTokens = rawUsage.inputTokens;
|
|
325
|
+
} else {
|
|
326
|
+
inputTokens = rawUsage.prompt_tokens ?? rawUsage.input_tokens ?? rawUsage.promptTokenCount ?? 0;
|
|
327
|
+
}
|
|
328
|
+
if (typeof rawUsage.outputTokens === "object" && rawUsage.outputTokens !== null) {
|
|
329
|
+
outputTokens = rawUsage.outputTokens.total ?? rawUsage.outputTokens.text ?? 0;
|
|
330
|
+
reasoningTokens = rawUsage.outputTokens.reasoning ?? 0;
|
|
331
|
+
} else if (typeof rawUsage.completionTokens === "number") {
|
|
332
|
+
outputTokens = rawUsage.completionTokens;
|
|
333
|
+
} else if (typeof rawUsage.outputTokens === "number") {
|
|
334
|
+
outputTokens = rawUsage.outputTokens;
|
|
335
|
+
} else {
|
|
336
|
+
outputTokens = rawUsage.completion_tokens ?? rawUsage.output_tokens ?? rawUsage.candidatesTokenCount ?? 0;
|
|
337
|
+
}
|
|
338
|
+
if (!reasoningTokens) {
|
|
339
|
+
reasoningTokens = rawUsage.completion_tokens_details?.reasoning_tokens ?? rawUsage.output_token_details?.reasoning_tokens ?? rawUsage.reasoning_tokens ?? rawUsage.reasoningTokens ?? rawUsage.thoughtsTokenCount ?? 0;
|
|
340
|
+
}
|
|
341
|
+
if (!cachedTokens) {
|
|
342
|
+
cachedTokens = rawUsage.prompt_tokens_details?.cached_tokens ?? rawUsage.input_token_details?.cached_tokens ?? rawUsage.prompt_cache_hit_tokens ?? rawUsage.cached_tokens ?? rawUsage.cachedTokens ?? rawUsage.cachedContentTokenCount ?? 0;
|
|
343
|
+
}
|
|
318
344
|
return {
|
|
319
345
|
model,
|
|
320
346
|
usage: {
|
|
@@ -460,10 +486,36 @@ function extractGenericResponseUsage(response, fallbackModel = "generic-llm", fa
|
|
|
460
486
|
if (!response || typeof response !== "object") return null;
|
|
461
487
|
const usage = response.usage || response.token_usage || response.usageMetadata;
|
|
462
488
|
if (usage) {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
489
|
+
let inputTokens = 0;
|
|
490
|
+
let outputTokens = 0;
|
|
491
|
+
let reasoningTokens = 0;
|
|
492
|
+
let cachedTokens = 0;
|
|
493
|
+
if (typeof usage.inputTokens === "object" && usage.inputTokens !== null) {
|
|
494
|
+
inputTokens = usage.inputTokens.total ?? usage.inputTokens.noCache ?? 0;
|
|
495
|
+
cachedTokens = usage.inputTokens.cacheRead ?? 0;
|
|
496
|
+
} else if (typeof usage.promptTokens === "number") {
|
|
497
|
+
inputTokens = usage.promptTokens;
|
|
498
|
+
} else if (typeof usage.inputTokens === "number") {
|
|
499
|
+
inputTokens = usage.inputTokens;
|
|
500
|
+
} else {
|
|
501
|
+
inputTokens = usage.prompt_tokens ?? usage.input_tokens ?? usage.promptTokenCount ?? usage.prompt_eval_count ?? 0;
|
|
502
|
+
}
|
|
503
|
+
if (typeof usage.outputTokens === "object" && usage.outputTokens !== null) {
|
|
504
|
+
outputTokens = usage.outputTokens.total ?? usage.outputTokens.text ?? 0;
|
|
505
|
+
reasoningTokens = usage.outputTokens.reasoning ?? 0;
|
|
506
|
+
} else if (typeof usage.completionTokens === "number") {
|
|
507
|
+
outputTokens = usage.completionTokens;
|
|
508
|
+
} else if (typeof usage.outputTokens === "number") {
|
|
509
|
+
outputTokens = usage.outputTokens;
|
|
510
|
+
} else {
|
|
511
|
+
outputTokens = usage.completion_tokens ?? usage.output_tokens ?? usage.candidatesTokenCount ?? usage.eval_count ?? 0;
|
|
512
|
+
}
|
|
513
|
+
if (!reasoningTokens) {
|
|
514
|
+
reasoningTokens = usage.reasoning_tokens ?? usage.thoughtsTokenCount ?? usage.completion_tokens_details?.reasoning_tokens ?? 0;
|
|
515
|
+
}
|
|
516
|
+
if (!cachedTokens) {
|
|
517
|
+
cachedTokens = usage.prompt_tokens_details?.cached_tokens ?? usage.cached_tokens ?? usage.cachedContentTokenCount ?? 0;
|
|
518
|
+
}
|
|
467
519
|
const model = response.model || fallbackModel;
|
|
468
520
|
const provider = response.provider || fallbackProvider;
|
|
469
521
|
return {
|
|
@@ -515,6 +567,10 @@ var MODEL_PRICING_TABLE = {
|
|
|
515
567
|
"chatgpt-4o-latest": { inputPer1M: 5, outputPer1M: 15 },
|
|
516
568
|
"gpt-4.1": { inputPer1M: 2, outputPer1M: 8, cachedInputPer1M: 1 },
|
|
517
569
|
"gpt-4.1-nano": { inputPer1M: 0.1, outputPer1M: 0.4, cachedInputPer1M: 0.05 },
|
|
570
|
+
"gpt-6-astra": { inputPer1M: 5, outputPer1M: 25, cachedInputPer1M: 0.5 },
|
|
571
|
+
"gpt-6-astra-fast": { inputPer1M: 3, outputPer1M: 15, cachedInputPer1M: 0.3 },
|
|
572
|
+
"gpt-image-2.5-flare": { inputPer1M: 0, outputPer1M: 0.04 },
|
|
573
|
+
"gpt-image-2.5-sunburst": { inputPer1M: 0, outputPer1M: 0.08 },
|
|
518
574
|
// --- OpenAI (Legacy & Backward Compatibility) ---
|
|
519
575
|
"gpt-4-turbo": { inputPer1M: 10, outputPer1M: 30, cachedInputPer1M: 5 },
|
|
520
576
|
"gpt-4-turbo-preview": { inputPer1M: 10, outputPer1M: 30, cachedInputPer1M: 5 },
|
|
@@ -567,7 +623,20 @@ var MODEL_PRICING_TABLE = {
|
|
|
567
623
|
"mistral-large-2411": { inputPer1M: 2, outputPer1M: 6 },
|
|
568
624
|
"codestral-latest": { inputPer1M: 0.3, outputPer1M: 0.9 },
|
|
569
625
|
"mistral-medium-latest": { inputPer1M: 2.7, outputPer1M: 8.1 },
|
|
626
|
+
"mistral-medium-3-5": { inputPer1M: 2, outputPer1M: 6, cachedInputPer1M: 0.4 },
|
|
627
|
+
"mistral-medium-2604": { inputPer1M: 2, outputPer1M: 6, cachedInputPer1M: 0.4 },
|
|
628
|
+
"magistral-small-latest": { inputPer1M: 0.5, outputPer1M: 1.5, cachedInputPer1M: 0.1 },
|
|
629
|
+
"magistral-medium-latest": { inputPer1M: 2, outputPer1M: 6, cachedInputPer1M: 0.4 },
|
|
570
630
|
"mistral-small-latest": { inputPer1M: 0.2, outputPer1M: 0.6 },
|
|
631
|
+
"mistral-small-2603": { inputPer1M: 0.2, outputPer1M: 0.6, cachedInputPer1M: 0.05 },
|
|
632
|
+
"mistral-vibe-cli-fast": { inputPer1M: 0.2, outputPer1M: 0.6, cachedInputPer1M: 0.05 },
|
|
633
|
+
"mistral-vibe-cli-latest": { inputPer1M: 0.2, outputPer1M: 0.6, cachedInputPer1M: 0.05 },
|
|
634
|
+
"codestral-2508": { inputPer1M: 0.3, outputPer1M: 0.9, cachedInputPer1M: 0.08 },
|
|
635
|
+
"codestral-embed": { inputPer1M: 0.1, outputPer1M: 0 },
|
|
636
|
+
"mistral-embed-2312": { inputPer1M: 0.1, outputPer1M: 0 },
|
|
637
|
+
"zai-glm-5-2": { inputPer1M: 0.6, outputPer1M: 2.2, cachedInputPer1M: 0.15 },
|
|
638
|
+
"glm-5-2": { inputPer1M: 0.6, outputPer1M: 2.2, cachedInputPer1M: 0.15 },
|
|
639
|
+
"labs-leanstral-1-5": { inputPer1M: 0.2, outputPer1M: 0.6, cachedInputPer1M: 0.05 },
|
|
571
640
|
"ministral-8b-latest": { inputPer1M: 0.1, outputPer1M: 0.1 },
|
|
572
641
|
"ministral-3b-latest": { inputPer1M: 0.04, outputPer1M: 0.04 },
|
|
573
642
|
"open-mistral-7b": { inputPer1M: 0.2, outputPer1M: 0.2 },
|
|
@@ -590,11 +659,17 @@ var MODEL_PRICING_TABLE = {
|
|
|
590
659
|
"gemma2-9b-it": { inputPer1M: 0.2, outputPer1M: 0.2 },
|
|
591
660
|
// --- DeepSeek ---
|
|
592
661
|
"deepseek-v4-pro": { inputPer1M: 0.66, outputPer1M: 1.98, cachedInputPer1M: 0.15 },
|
|
662
|
+
"deepseek-v4.1-flash": { inputPer1M: 0.2, outputPer1M: 0.6, cachedInputPer1M: 0.05 },
|
|
593
663
|
"deepseek-v4-flash": { inputPer1M: 0.22, outputPer1M: 0.66, cachedInputPer1M: 0.05 },
|
|
594
664
|
"deepseek-v3": { inputPer1M: 0.14, outputPer1M: 0.28, cachedInputPer1M: 0.014 },
|
|
595
665
|
"deepseek-chat": { inputPer1M: 0.14, outputPer1M: 0.28, cachedInputPer1M: 0.014 },
|
|
596
666
|
"deepseek-r1": { inputPer1M: 0.55, outputPer1M: 2.19, cachedInputPer1M: 0.14 },
|
|
597
667
|
"deepseek-reasoner": { inputPer1M: 0.55, outputPer1M: 2.19, cachedInputPer1M: 0.14 },
|
|
668
|
+
// --- Gateway, Inception & InclusionAI Models ---
|
|
669
|
+
"mercury-2.5": { inputPer1M: 0.25, outputPer1M: 0.75, cachedInputPer1M: 0.05 },
|
|
670
|
+
"mercury-2": { inputPer1M: 0.25, outputPer1M: 0.75, cachedInputPer1M: 0.05 },
|
|
671
|
+
"ling-3.0-flash-sante": { inputPer1M: 0.15, outputPer1M: 0.45, cachedInputPer1M: 0.03 },
|
|
672
|
+
"ling-3.0-flash": { inputPer1M: 0.15, outputPer1M: 0.45, cachedInputPer1M: 0.03 },
|
|
598
673
|
// --- Cohere ---
|
|
599
674
|
"command-r-plus": { inputPer1M: 2.5, outputPer1M: 10 },
|
|
600
675
|
"command-r": { inputPer1M: 0.15, outputPer1M: 0.6 },
|
|
@@ -642,7 +717,15 @@ var MODEL_ALIASES = {
|
|
|
642
717
|
// Mistral Shorthands
|
|
643
718
|
"codestral": "codestral-latest",
|
|
644
719
|
"mistral-large": "mistral-large-latest",
|
|
645
|
-
"mistral-small": "mistral-small-latest"
|
|
720
|
+
"mistral-small": "mistral-small-latest",
|
|
721
|
+
"magistral": "magistral-small-latest",
|
|
722
|
+
"magistral-small": "magistral-small-latest",
|
|
723
|
+
"magistral-medium": "magistral-medium-latest",
|
|
724
|
+
"mistral-3.5": "mistral-medium-3-5",
|
|
725
|
+
"mistral-medium-3.5": "mistral-medium-3-5",
|
|
726
|
+
"gpt-image-2.5": "gpt-image-2.5-flare",
|
|
727
|
+
"gpt-image-sunburst": "gpt-image-2.5-sunburst",
|
|
728
|
+
"gpt-image-flare": "gpt-image-2.5-flare"
|
|
646
729
|
};
|
|
647
730
|
var customPricingRegistry = {};
|
|
648
731
|
function normalizeModelKey(rawModel) {
|
|
@@ -1141,11 +1224,41 @@ function withBilling(model, optionsOrCustomer, extraOptions = {}) {
|
|
|
1141
1224
|
};
|
|
1142
1225
|
const handleUsage = (rawUsage, extraMeta) => {
|
|
1143
1226
|
if (!rawUsage) return;
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1227
|
+
let inputTokens = 0;
|
|
1228
|
+
let outputTokens = 0;
|
|
1229
|
+
let reasoningTokens = 0;
|
|
1230
|
+
let cachedTokens = 0;
|
|
1231
|
+
let cacheWriteTokens = 0;
|
|
1232
|
+
if (typeof rawUsage.inputTokens === "object" && rawUsage.inputTokens !== null) {
|
|
1233
|
+
inputTokens = rawUsage.inputTokens.total ?? rawUsage.inputTokens.noCache ?? 0;
|
|
1234
|
+
cachedTokens = rawUsage.inputTokens.cacheRead ?? 0;
|
|
1235
|
+
cacheWriteTokens = rawUsage.inputTokens.cacheWrite ?? 0;
|
|
1236
|
+
} else if (typeof rawUsage.promptTokens === "number") {
|
|
1237
|
+
inputTokens = rawUsage.promptTokens;
|
|
1238
|
+
} else if (typeof rawUsage.inputTokens === "number") {
|
|
1239
|
+
inputTokens = rawUsage.inputTokens;
|
|
1240
|
+
} else {
|
|
1241
|
+
inputTokens = rawUsage.prompt_tokens ?? rawUsage.input_tokens ?? rawUsage.promptTokenCount ?? 0;
|
|
1242
|
+
}
|
|
1243
|
+
if (typeof rawUsage.outputTokens === "object" && rawUsage.outputTokens !== null) {
|
|
1244
|
+
outputTokens = rawUsage.outputTokens.total ?? rawUsage.outputTokens.text ?? 0;
|
|
1245
|
+
reasoningTokens = rawUsage.outputTokens.reasoning ?? 0;
|
|
1246
|
+
} else if (typeof rawUsage.completionTokens === "number") {
|
|
1247
|
+
outputTokens = rawUsage.completionTokens;
|
|
1248
|
+
} else if (typeof rawUsage.outputTokens === "number") {
|
|
1249
|
+
outputTokens = rawUsage.outputTokens;
|
|
1250
|
+
} else {
|
|
1251
|
+
outputTokens = rawUsage.completion_tokens ?? rawUsage.output_tokens ?? rawUsage.candidatesTokenCount ?? 0;
|
|
1252
|
+
}
|
|
1253
|
+
if (!reasoningTokens) {
|
|
1254
|
+
reasoningTokens = rawUsage.reasoningTokens ?? rawUsage.completionTokensDetails?.reasoningTokens ?? rawUsage.outputTokenDetails?.reasoningTokens ?? rawUsage.reasoning_tokens ?? rawUsage.completion_tokens_details?.reasoning_tokens ?? rawUsage.output_token_details?.reasoning_tokens ?? rawUsage.thoughtsTokenCount ?? 0;
|
|
1255
|
+
}
|
|
1256
|
+
if (!cachedTokens) {
|
|
1257
|
+
cachedTokens = rawUsage.promptTokensDetails?.cachedTokens ?? rawUsage.inputTokenDetails?.cachedTokens ?? rawUsage.cachedTokens ?? rawUsage.cached_tokens ?? rawUsage.prompt_tokens_details?.cached_tokens ?? rawUsage.input_token_details?.cached_tokens ?? rawUsage.cachedContentTokenCount ?? rawUsage.cache_read_input_tokens ?? 0;
|
|
1258
|
+
}
|
|
1259
|
+
if (!cacheWriteTokens) {
|
|
1260
|
+
cacheWriteTokens = rawUsage.cacheWriteTokens ?? rawUsage.cache_creation_input_tokens ?? rawUsage.cacheCreationTokens ?? 0;
|
|
1261
|
+
}
|
|
1149
1262
|
const usage = {
|
|
1150
1263
|
inputTokens,
|
|
1151
1264
|
outputTokens,
|
|
@@ -1346,16 +1459,22 @@ function withBilling(model, optionsOrCustomer, extraOptions = {}) {
|
|
|
1346
1459
|
const transformStream = new TransformStream({
|
|
1347
1460
|
transform(chunk, controller) {
|
|
1348
1461
|
controller.enqueue(chunk);
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1462
|
+
if (chunk.type === "text-delta" && typeof chunk.delta === "string") {
|
|
1463
|
+
accumulatedChars += chunk.delta.length;
|
|
1464
|
+
} else if (chunk.type === "reasoning-delta" && typeof chunk.delta === "string") {
|
|
1465
|
+
accumulatedChars += chunk.delta.length;
|
|
1466
|
+
} else {
|
|
1467
|
+
const delta = chunk.textDelta || chunk.text || chunk.delta;
|
|
1468
|
+
if (delta && typeof delta === "string") {
|
|
1469
|
+
accumulatedChars += delta.length;
|
|
1470
|
+
} else if (chunk.type === "reasoning" || chunk.type === "reasoning-delta") {
|
|
1471
|
+
const reasoning = chunk.reasoning || chunk.textDelta || chunk.text || chunk.delta || "";
|
|
1472
|
+
if (typeof reasoning === "string") {
|
|
1473
|
+
accumulatedChars += reasoning.length;
|
|
1474
|
+
}
|
|
1356
1475
|
}
|
|
1357
1476
|
}
|
|
1358
|
-
const chunkUsage = chunk.usage || chunk.token_usage || chunk.usageMetadata;
|
|
1477
|
+
const chunkUsage = (chunk.type === "finish" ? chunk.usage : null) || chunk.usage || chunk.token_usage || chunk.usageMetadata;
|
|
1359
1478
|
if (chunkUsage) {
|
|
1360
1479
|
streamCompleted = true;
|
|
1361
1480
|
handleUsage(chunkUsage);
|
|
@@ -1434,12 +1553,16 @@ function createVibezModel(modelOrId, options = {}) {
|
|
|
1434
1553
|
providerName = "deepseek";
|
|
1435
1554
|
} else if (rawId.startsWith("grok-")) {
|
|
1436
1555
|
providerName = "xai";
|
|
1437
|
-
} else if (rawId.startsWith("mistral-") || rawId.startsWith("codestral-") || rawId.startsWith("ministral-") || rawId.startsWith("open-mistral") || rawId.startsWith("open-mixtral")) {
|
|
1556
|
+
} else if (rawId.startsWith("mistral-") || rawId.startsWith("codestral-") || rawId.startsWith("ministral-") || rawId.startsWith("magistral-") || rawId.startsWith("voxtral-") || rawId.startsWith("devstral-") || rawId.startsWith("open-mistral") || rawId.startsWith("open-mixtral")) {
|
|
1438
1557
|
providerName = "mistral";
|
|
1439
1558
|
} else if (rawId.startsWith("llama-") || rawId.startsWith("mixtral-") || rawId.startsWith("gemma") || rawId.startsWith("qwen-")) {
|
|
1440
1559
|
providerName = "groq";
|
|
1441
1560
|
} else if (rawId.startsWith("command-")) {
|
|
1442
1561
|
providerName = "cohere";
|
|
1562
|
+
} else if (rawId.startsWith("mercury-") || rawId.startsWith("ling-")) {
|
|
1563
|
+
providerName = "gateway";
|
|
1564
|
+
} else if (rawId.startsWith("gpt-image-") || rawId.startsWith("gpt-6-")) {
|
|
1565
|
+
providerName = "openai";
|
|
1443
1566
|
}
|
|
1444
1567
|
const apiKey = options.apiKey || process.env.AI_GATEWAY_API_KEY || (providerName === "anthropic" ? process.env.ANTHROPIC_API_KEY : void 0) || (providerName === "google" ? process.env.GOOGLE_GENERATIVE_AI_API_KEY : void 0) || (providerName === "mistral" ? process.env.MISTRAL_API_KEY : void 0) || (providerName === "groq" ? process.env.GROQ_API_KEY : void 0) || (providerName === "deepseek" ? process.env.DEEPSEEK_API_KEY : void 0) || (providerName === "xai" ? process.env.XAI_API_KEY : void 0) || (providerName === "cohere" ? process.env.COHERE_API_KEY : void 0) || process.env.OPENAI_API_KEY;
|
|
1445
1568
|
const baseURL = options.baseURL || process.env.AI_GATEWAY_BASE_URL || (providerName === "openai" ? "https://api.openai.com/v1" : void 0);
|