ai 7.0.0-beta.182 → 7.0.0-beta.183

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,12 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.0-beta.183
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [8e990ff]
8
+ - @ai-sdk/gateway@4.0.0-beta.111
9
+
3
10
  ## 7.0.0-beta.182
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1088,7 +1088,7 @@ import {
1088
1088
  } from "@ai-sdk/provider-utils";
1089
1089
 
1090
1090
  // src/version.ts
1091
- var VERSION = true ? "7.0.0-beta.182" : "0.0.0-test";
1091
+ var VERSION = true ? "7.0.0-beta.183" : "0.0.0-test";
1092
1092
 
1093
1093
  // src/util/download/download.ts
1094
1094
  var download = async ({
@@ -83,7 +83,7 @@ import {
83
83
  } from "@ai-sdk/provider-utils";
84
84
 
85
85
  // src/version.ts
86
- var VERSION = true ? "7.0.0-beta.182" : "0.0.0-test";
86
+ var VERSION = true ? "7.0.0-beta.183" : "0.0.0-test";
87
87
 
88
88
  // src/util/download/download.ts
89
89
  var download = async ({
@@ -87,6 +87,8 @@ console.log(
87
87
 
88
88
  When working with reasoning models, you may want to see _how_ the model arrived at its answer. The `reasoningSummary` option surfaces the model's thought process.
89
89
 
90
+ When `reasoningEffort` is set to a value other than `'none'`, the OpenAI Responses provider defaults `reasoningSummary` to `'detailed'`. Set `reasoningSummary: null` to omit reasoning summaries.
91
+
90
92
  #### Streaming
91
93
 
92
94
  ```ts
@@ -627,7 +627,9 @@ whether approval is required (see [Tool Approval](#tool-approval) above).
627
627
 
628
628
  ### `uiMessages` / `collectUIMessages` is gone
629
629
 
630
- `DurableAgent.stream()` returned accumulated `uiMessages` when `collectUIMessages: true` was set. `WorkflowAgent.stream()` returns `ModelMessage[]` on `result.messages` instead — persist those and convert them at the edge with `convertToModelMessages` / `convertToUIMessages` as needed.
630
+ `DurableAgent.stream()` returned accumulated `uiMessages` when `collectUIMessages: true` was set. `WorkflowAgent.stream()` returns `ModelMessage[]` on `result.messages` instead.
631
+
632
+ For persistence, store `UIMessage[]` as your source of truth and call [`convertToModelMessages`](/docs/reference/ai-sdk-ui/convert-to-model-messages) before passing them to the agent — this is the pattern described in [Chatbot Message Persistence](/docs/ai-sdk-ui/chatbot-message-persistence). There is no built-in `ModelMessage` → `UIMessage` conversion, so avoid persisting `result.messages` as your only copy if you need to render the conversation in the UI later.
631
633
 
632
634
  ```diff
633
635
  const result = await agent.stream({
@@ -55,6 +55,31 @@ await runAgentTUI({
55
55
 
56
56
  `runAgentTUI` runs until the user exits with `Esc` or `Ctrl+C`.
57
57
 
58
+ ## Sandbox
59
+
60
+ Pass a sandbox session with the `sandbox` option when your agent tools need an
61
+ execution environment:
62
+
63
+ ```ts
64
+ import { createJustBashSandbox } from '@ai-sdk/sandbox-just-bash';
65
+
66
+ const sandboxSession = await createJustBashSandbox({
67
+ cwd: '/home/user',
68
+ }).createSession();
69
+
70
+ await runAgentTUI({
71
+ title: 'Sandbox Agent',
72
+ agent,
73
+ sandbox: sandboxSession.restricted(),
74
+ });
75
+ ```
76
+
77
+ The terminal UI forwards the sandbox to every agent call as
78
+ `experimental_sandbox`. Tool description functions and tool `execute` functions
79
+ can read it from their options and delegate command or file operations to it.
80
+ Add the sandbox description to your agent instructions if the model should know
81
+ details such as the working directory, public hostname, or exposed ports.
82
+
58
83
  ## Display Options
59
84
 
60
85
  You can control how tool calls, reasoning, and response statistics are shown:
@@ -88,6 +88,13 @@ await runAgentTUI({
88
88
  description:
89
89
  'The model context window size in tokens. When provided, the terminal UI shows total token usage as a percentage of this context window.',
90
90
  },
91
+ {
92
+ name: 'sandbox',
93
+ type: 'Experimental_SandboxSession',
94
+ isOptional: true,
95
+ description:
96
+ 'Sandbox session that is passed through to the agent as `experimental_sandbox` on every call.',
97
+ },
91
98
  ],
92
99
  },
93
100
  ],
@@ -161,6 +168,28 @@ await runAgentTUI({
161
168
  });
162
169
  ```
163
170
 
171
+ ## Example with Sandbox
172
+
173
+ ```ts
174
+ import { createJustBashSandbox } from '@ai-sdk/sandbox-just-bash';
175
+
176
+ const sandboxSession = await createJustBashSandbox({
177
+ cwd: '/home/user',
178
+ }).createSession();
179
+
180
+ await runAgentTUI({
181
+ title: 'Sandbox Assistant',
182
+ agent,
183
+ sandbox: sandboxSession.restricted(),
184
+ });
185
+ ```
186
+
187
+ The sandbox is forwarded to every `agent.stream()` call as
188
+ `experimental_sandbox`, making it available to tool description functions and
189
+ tool `execute` functions. Include the sandbox description in the agent
190
+ instructions when the model should know sandbox-specific details such as the
191
+ working directory or exposed ports.
192
+
164
193
  ## Compatibility
165
194
 
166
195
  Use `runAgentTUI` for agents that can run directly from free-form user input.
@@ -5,6 +5,18 @@ description: Learn how to upgrade AI SDK 6.x to 7.0.
5
5
 
6
6
  # Migrate AI SDK 6.x to 7.0
7
7
 
8
+ Use the command below to add the migration skill:
9
+
10
+ ```bash
11
+ npx skills add vercel/ai --skill migrate-ai-sdk-v6-to-v7
12
+ ```
13
+
14
+ Then ask your agent:
15
+
16
+ ```txt
17
+ Use the migrate-ai-sdk-v6-to-v7 skill and migrate my app from AI SDK v6 to v7.
18
+ ```
19
+
8
20
  ## Recommended Migration Process
9
21
 
10
22
  1. Backup your project. If you use a versioning control system, make sure all previous versions are committed.
@@ -1821,6 +1833,14 @@ const { messages, sendMessage } = useChat(() => ({
1821
1833
 
1822
1834
  The `Chat` class continues to work as a deprecated export, so you can migrate incrementally.
1823
1835
 
1836
+ ## OpenAI Provider
1837
+
1838
+ ### Responses Reasoning Summary Defaults to Detailed
1839
+
1840
+ For the OpenAI Responses provider, setting `reasoning` or `providerOptions.openai.reasoningEffort` to a value other than `'none'` now defaults `providerOptions.openai.reasoningSummary` to `'detailed'`.
1841
+
1842
+ If you want to keep reasoning summaries disabled, set `providerOptions.openai.reasoningSummary` to `null`.
1843
+
1824
1844
  ## Anthropic Provider
1825
1845
 
1826
1846
  ### `providerMetadata.anthropic.cacheCreationInputTokens` Removed
@@ -1862,3 +1882,11 @@ Every type, class, and function in `@ai-sdk/google` that contained `GoogleGenera
1862
1882
  The old names still work as deprecated aliases, but you should migrate to the new names, if you currently reference them.
1863
1883
 
1864
1884
  The main entry point the `google` constant, remains unchanged, so if that's all you use from the provider, no changes are required.
1885
+
1886
+ # Migration Skill
1887
+
1888
+ Use the command below to add the migration skill and guide your agent
1889
+
1890
+ ```bash
1891
+ npx skills add vercel/ai --skill migrate-ai-sdk-v6-to-v7
1892
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "7.0.0-beta.182",
3
+ "version": "7.0.0-beta.183",
4
4
  "type": "module",
5
5
  "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@ai-sdk/gateway": "4.0.0-beta.110",
45
+ "@ai-sdk/gateway": "4.0.0-beta.111",
46
46
  "@ai-sdk/provider": "4.0.0-beta.19",
47
47
  "@ai-sdk/provider-utils": "5.0.0-beta.49"
48
48
  },