ai 6.0.0-beta.148 → 6.0.0-beta.149
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/CHANGELOG.md +6 -0
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -962,7 +962,7 @@ function detectMediaType({
|
|
|
962
962
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
963
963
|
|
|
964
964
|
// src/version.ts
|
|
965
|
-
var VERSION = true ? "6.0.0-beta.
|
|
965
|
+
var VERSION = true ? "6.0.0-beta.149" : "0.0.0-test";
|
|
966
966
|
|
|
967
967
|
// src/util/download/download.ts
|
|
968
968
|
var download = async ({ url }) => {
|
|
@@ -1817,14 +1817,28 @@ async function standardizePrompt(prompt) {
|
|
|
1817
1817
|
var import_gateway2 = require("@ai-sdk/gateway");
|
|
1818
1818
|
var import_provider20 = require("@ai-sdk/provider");
|
|
1819
1819
|
function wrapGatewayError(error) {
|
|
1820
|
-
if (import_gateway2.GatewayAuthenticationError.isInstance(error)
|
|
1820
|
+
if (!import_gateway2.GatewayAuthenticationError.isInstance(error))
|
|
1821
|
+
return error;
|
|
1822
|
+
const isProductionEnv = (process == null ? void 0 : process.env.NODE_ENV) === "production";
|
|
1823
|
+
const moreInfoURL = "https://v6.ai-sdk.dev/unauthenticated-ai-gateway";
|
|
1824
|
+
if (isProductionEnv) {
|
|
1821
1825
|
return new import_provider20.AISDKError({
|
|
1822
1826
|
name: "GatewayError",
|
|
1823
|
-
message:
|
|
1824
|
-
cause: error
|
|
1827
|
+
message: `Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${moreInfoURL}`
|
|
1825
1828
|
});
|
|
1826
1829
|
}
|
|
1827
|
-
return
|
|
1830
|
+
return Object.assign(
|
|
1831
|
+
new Error(`\x1B[1m\x1B[31mUnauthenticated request to AI Gateway.\x1B[0m
|
|
1832
|
+
|
|
1833
|
+
To authenticate, set the \x1B[33mAI_GATEWAY_API_KEY\x1B[0m environment variable with your API key.
|
|
1834
|
+
|
|
1835
|
+
Alternatively, you can use a provider module instead of the AI Gateway.
|
|
1836
|
+
|
|
1837
|
+
Learn more: \x1B[34m${moreInfoURL}\x1B[0m
|
|
1838
|
+
|
|
1839
|
+
`),
|
|
1840
|
+
{ name: "GatewayAuthenticationError" }
|
|
1841
|
+
);
|
|
1828
1842
|
}
|
|
1829
1843
|
|
|
1830
1844
|
// src/telemetry/assemble-operation-name.ts
|