ai 6.0.19 → 6.0.21

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 9667780: fix(ai): preserve `rawInput` in `safeValidateUIMessages` for `output-error` tool parts
8
+
9
+ Fixes #11406
10
+
11
+ ## 6.0.20
12
+
13
+ ### Patch Changes
14
+
15
+ - f748c46: Updated Unified Provider Architecture section in README to describe AI Gateway as the default.
16
+
3
17
  ## 6.0.19
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -18,12 +18,21 @@ npm install ai
18
18
 
19
19
  The AI SDK provides a [unified API](https://ai-sdk.dev/docs/foundations/providers-and-models) to interact with model providers like [OpenAI](https://ai-sdk.dev/providers/ai-sdk-providers/openai), [Anthropic](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic), [Google](https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai), and [more](https://ai-sdk.dev/providers/ai-sdk-providers).
20
20
 
21
+ By default, the AI SDK uses the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) to give you access to all major providers out of the box. Just pass a model string for any supported model:
22
+
23
+ ```ts
24
+ const result = await generateText({
25
+ model: 'anthropic/claude-opus-4.5', // or 'openai/gpt-5.2', 'google/gemini-3-flash', etc.
26
+ prompt: 'Hello!',
27
+ });
28
+ ```
29
+
30
+ You can also connect to providers directly using their SDK packages:
31
+
21
32
  ```shell
22
33
  npm install @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google
23
34
  ```
24
35
 
25
- Alternatively you can use the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway).
26
-
27
36
  ## Usage
28
37
 
29
38
  ### Generating Text
package/dist/index.js CHANGED
@@ -1013,7 +1013,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1013
1013
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1014
1014
 
1015
1015
  // src/version.ts
1016
- var VERSION = true ? "6.0.19" : "0.0.0-test";
1016
+ var VERSION = true ? "6.0.21" : "0.0.0-test";
1017
1017
 
1018
1018
  // src/util/download/download.ts
1019
1019
  var download = async ({ url }) => {
@@ -7794,6 +7794,7 @@ var uiMessagesSchema = (0, import_provider_utils22.lazySchema)(
7794
7794
  toolCallId: import_v48.z.string(),
7795
7795
  state: import_v48.z.literal("output-error"),
7796
7796
  input: import_v48.z.unknown(),
7797
+ rawInput: import_v48.z.unknown().optional(),
7797
7798
  providerExecuted: import_v48.z.boolean().optional(),
7798
7799
  output: import_v48.z.never().optional(),
7799
7800
  errorText: import_v48.z.string(),
@@ -7893,6 +7894,7 @@ var uiMessagesSchema = (0, import_provider_utils22.lazySchema)(
7893
7894
  state: import_v48.z.literal("output-error"),
7894
7895
  providerExecuted: import_v48.z.boolean().optional(),
7895
7896
  input: import_v48.z.unknown(),
7897
+ rawInput: import_v48.z.unknown().optional(),
7896
7898
  output: import_v48.z.never().optional(),
7897
7899
  errorText: import_v48.z.string(),
7898
7900
  callProviderMetadata: providerMetadataSchema.optional(),