ai 5.0.111 → 5.0.113

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.mjs CHANGED
@@ -684,7 +684,7 @@ import {
684
684
  } from "@ai-sdk/provider-utils";
685
685
 
686
686
  // src/version.ts
687
- var VERSION = true ? "5.0.111" : "0.0.0-test";
687
+ var VERSION = true ? "5.0.113" : "0.0.0-test";
688
688
 
689
689
  // src/util/download/download.ts
690
690
  var download = async ({ url }) => {
@@ -1403,20 +1403,31 @@ async function standardizePrompt(prompt) {
1403
1403
  }
1404
1404
 
1405
1405
  // src/prompt/wrap-gateway-error.ts
1406
- import {
1407
- GatewayAuthenticationError,
1408
- GatewayModelNotFoundError
1409
- } from "@ai-sdk/gateway";
1406
+ import { GatewayAuthenticationError } from "@ai-sdk/gateway";
1410
1407
  import { AISDKError as AISDKError19 } from "@ai-sdk/provider";
1411
1408
  function wrapGatewayError(error) {
1412
- if (GatewayAuthenticationError.isInstance(error) || GatewayModelNotFoundError.isInstance(error)) {
1409
+ if (!GatewayAuthenticationError.isInstance(error))
1410
+ return error;
1411
+ const isProductionEnv = (process == null ? void 0 : process.env.NODE_ENV) === "production";
1412
+ const moreInfoURL = "https://ai-sdk.dev/unauthenticated-ai-gateway";
1413
+ if (isProductionEnv) {
1413
1414
  return new AISDKError19({
1414
1415
  name: "GatewayError",
1415
- message: "Unauthenticated. Configure AI_GATEWAY_API_KEY or configure and use a provider module. Learn more: https://vercel.link/unauthenticated-ai-gateway",
1416
- cause: error
1416
+ message: `Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${moreInfoURL}`
1417
1417
  });
1418
1418
  }
1419
- return error;
1419
+ return Object.assign(
1420
+ new Error(`\x1B[1m\x1B[31mUnauthenticated request to AI Gateway.\x1B[0m
1421
+
1422
+ To authenticate, set the \x1B[33mAI_GATEWAY_API_KEY\x1B[0m environment variable with your API key.
1423
+
1424
+ Alternatively, you can use a provider module instead of the AI Gateway.
1425
+
1426
+ Learn more: \x1B[34m${moreInfoURL}\x1B[0m
1427
+
1428
+ `),
1429
+ { name: "GatewayAuthenticationError" }
1430
+ );
1420
1431
  }
1421
1432
 
1422
1433
  // src/telemetry/assemble-operation-name.ts