@broberg/ai-sdk 0.36.2 → 0.36.3

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/index.d.ts CHANGED
@@ -2178,8 +2178,8 @@ declare const falStubAdapter: ProviderAdapter;
2178
2178
  * wires the live adapters. */
2179
2179
  declare const stubProviders: Record<string, ProviderAdapter>;
2180
2180
 
2181
- declare const VERSION: "0.36.2";
2182
- declare const SDK_TAG: "@broberg/ai-sdk@0.36.2";
2181
+ declare const VERSION: "0.36.3";
2182
+ declare const SDK_TAG: "@broberg/ai-sdk@0.36.3";
2183
2183
 
2184
2184
  /** Built-in defaults. Every entry is overridable via AiConfig.defaults or a
2185
2185
  * per-call override.
package/dist/index.js CHANGED
@@ -1314,6 +1314,11 @@ function mistralAdapter(config = {}) {
1314
1314
  const pagesProcessed = data.usage_info?.pages_processed ?? pages.length;
1315
1315
  const usage = freshUsage({
1316
1316
  provider: "mistral",
1317
+ // From the URL we actually called. mistral is deliberately ABSENT from the
1318
+ // provider-name table (config.baseUrl can move it), so omitting this here made
1319
+ // these four report "unknown" instead of "eu" — a regression shipped in 0.36.0
1320
+ // that broke the very enforcement we told consumers to write.
1321
+ region: regionOfHost(baseUrl),
1317
1322
  model: req.spec.model,
1318
1323
  transport: "http",
1319
1324
  capability: "ocr",
@@ -1345,6 +1350,11 @@ function mistralAdapter(config = {}) {
1345
1350
  const estIn = req.input.reduce((n, s) => n + Math.ceil(s.length / 4), 0);
1346
1351
  const usage = freshUsage({
1347
1352
  provider: "mistral",
1353
+ // From the URL we actually called. mistral is deliberately ABSENT from the
1354
+ // provider-name table (config.baseUrl can move it), so omitting this here made
1355
+ // these four report "unknown" instead of "eu" — a regression shipped in 0.36.0
1356
+ // that broke the very enforcement we told consumers to write.
1357
+ region: regionOfHost(baseUrl),
1348
1358
  model: req.spec.model,
1349
1359
  transport: "http",
1350
1360
  capability: "moderation",
@@ -1367,6 +1377,11 @@ function mistralAdapter(config = {}) {
1367
1377
  const vectors = (data.data ?? []).map((d) => d.embedding);
1368
1378
  const usage = freshUsage({
1369
1379
  provider: "mistral",
1380
+ // From the URL we actually called. mistral is deliberately ABSENT from the
1381
+ // provider-name table (config.baseUrl can move it), so omitting this here made
1382
+ // these four report "unknown" instead of "eu" — a regression shipped in 0.36.0
1383
+ // that broke the very enforcement we told consumers to write.
1384
+ region: regionOfHost(baseUrl),
1370
1385
  model: req.spec.model,
1371
1386
  transport: "http",
1372
1387
  capability: "embedding",
@@ -1392,6 +1407,11 @@ function mistralAdapter(config = {}) {
1392
1407
  const data = await res.json();
1393
1408
  const usage = freshUsage({
1394
1409
  provider: "mistral",
1410
+ // From the URL we actually called. mistral is deliberately ABSENT from the
1411
+ // provider-name table (config.baseUrl can move it), so omitting this here made
1412
+ // these four report "unknown" instead of "eu" — a regression shipped in 0.36.0
1413
+ // that broke the very enforcement we told consumers to write.
1414
+ region: regionOfHost(baseUrl),
1395
1415
  model: req.spec.model,
1396
1416
  transport: "http",
1397
1417
  capability: "transcribe",
@@ -2966,8 +2986,8 @@ var aiConfigSchema = z.object({
2966
2986
  });
2967
2987
 
2968
2988
  // src/version.ts
2969
- var VERSION = "0.36.2";
2970
- var SDK_TAG = "@broberg/ai-sdk@0.36.2";
2989
+ var VERSION = "0.36.3";
2990
+ var SDK_TAG = "@broberg/ai-sdk@0.36.3";
2971
2991
 
2972
2992
  // src/cost/sinks/upmetrics.ts
2973
2993
  function upmetricsSink(config) {