ai 6.0.276 → 6.0.278
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 +15 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/02-foundations/02-providers-and-models.mdx +1 -1
- package/docs/03-ai-sdk-core/16-mcp-tools.mdx +63 -0
- package/docs/03-ai-sdk-core/37-speech.mdx +0 -17
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.278
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [fc032e8]
|
|
8
|
+
- Updated dependencies [761dae9]
|
|
9
|
+
- @ai-sdk/gateway@3.0.190
|
|
10
|
+
|
|
11
|
+
## 6.0.277
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [8839d87]
|
|
16
|
+
- @ai-sdk/gateway@3.0.189
|
|
17
|
+
|
|
3
18
|
## 6.0.276
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1334,7 +1334,7 @@ function detectMediaType({
|
|
|
1334
1334
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
1335
1335
|
|
|
1336
1336
|
// src/version.ts
|
|
1337
|
-
var VERSION = true ? "6.0.
|
|
1337
|
+
var VERSION = true ? "6.0.278" : "0.0.0-test";
|
|
1338
1338
|
|
|
1339
1339
|
// src/util/download/download.ts
|
|
1340
1340
|
var download = async ({
|
package/dist/index.mjs
CHANGED
|
@@ -1224,7 +1224,7 @@ import {
|
|
|
1224
1224
|
} from "@ai-sdk/provider-utils";
|
|
1225
1225
|
|
|
1226
1226
|
// src/version.ts
|
|
1227
|
-
var VERSION = true ? "6.0.
|
|
1227
|
+
var VERSION = true ? "6.0.278" : "0.0.0-test";
|
|
1228
1228
|
|
|
1229
1229
|
// src/util/download/download.ts
|
|
1230
1230
|
var download = async ({
|
package/dist/internal/index.js
CHANGED
|
@@ -164,7 +164,7 @@ function detectMediaType({
|
|
|
164
164
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
165
165
|
|
|
166
166
|
// src/version.ts
|
|
167
|
-
var VERSION = true ? "6.0.
|
|
167
|
+
var VERSION = true ? "6.0.278" : "0.0.0-test";
|
|
168
168
|
|
|
169
169
|
// src/util/download/download.ts
|
|
170
170
|
var download = async ({
|
package/dist/internal/index.mjs
CHANGED
|
@@ -41,7 +41,6 @@ The AI SDK comes with a wide range of providers that you can use to interact wit
|
|
|
41
41
|
- [Groq Provider](/providers/ai-sdk-providers/groq) (`@ai-sdk/groq`)
|
|
42
42
|
- [Perplexity Provider](/providers/ai-sdk-providers/perplexity) (`@ai-sdk/perplexity`)
|
|
43
43
|
- [ElevenLabs Provider](/providers/ai-sdk-providers/elevenlabs) (`@ai-sdk/elevenlabs`)
|
|
44
|
-
- [LMNT Provider](/providers/ai-sdk-providers/lmnt) (`@ai-sdk/lmnt`)
|
|
45
44
|
- [Hume Provider](/providers/ai-sdk-providers/hume) (`@ai-sdk/hume`)
|
|
46
45
|
- [Rev.ai Provider](/providers/ai-sdk-providers/revai) (`@ai-sdk/revai`)
|
|
47
46
|
- [Deepgram Provider](/providers/ai-sdk-providers/deepgram) (`@ai-sdk/deepgram`)
|
|
@@ -118,6 +117,7 @@ Here are the capabilities of popular models:
|
|
|
118
117
|
| [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-3` | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
119
118
|
| [xAI Grok](/providers/ai-sdk-providers/xai) | `grok-3-mini` | <Cross size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
120
119
|
| [Vercel](/providers/ai-sdk-providers/vercel) | `v0-1.0-md` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
120
|
+
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-6-astra` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
121
121
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.6` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
122
122
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.6-luna` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
123
123
|
| [OpenAI](/providers/ai-sdk-providers/openai) | `gpt-5.6-sol` | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> | <Check size={18} /> |
|
|
@@ -240,6 +240,69 @@ const tools = await mcpClient.tools();
|
|
|
240
240
|
|
|
241
241
|
This approach is simpler to implement and automatically stays in sync with server changes. However, you won't have TypeScript type safety during development, and all tools from the server will be loaded
|
|
242
242
|
|
|
243
|
+
### Tool Annotations and Approval
|
|
244
|
+
|
|
245
|
+
MCP servers can describe tool behavior with annotations such as
|
|
246
|
+
`readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`. The
|
|
247
|
+
MCP client exposes these annotations on each tool's `metadata.annotations` and
|
|
248
|
+
on the resulting tool call's `toolMetadata.annotations`.
|
|
249
|
+
|
|
250
|
+
Annotations are untrusted, server-provided hints. The MCP client does not turn
|
|
251
|
+
them into an approval policy automatically. Applications should combine them
|
|
252
|
+
with deterministic controls such as tool allowlists, scoped credentials, and
|
|
253
|
+
their own [`needsApproval`](/docs/ai-sdk-core/tools-and-tool-calling#tool-execution-approval)
|
|
254
|
+
policy.
|
|
255
|
+
|
|
256
|
+
The following conservative policy allows tools to run automatically only when
|
|
257
|
+
the server explicitly marks them as read-only. Tools with `readOnlyHint: false`
|
|
258
|
+
or no `readOnlyHint` require user approval:
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
import { type McpProviderMetadata } from '@ai-sdk/mcp';
|
|
262
|
+
|
|
263
|
+
const mcpTools = await mcpClient.tools();
|
|
264
|
+
const tools = Object.fromEntries(
|
|
265
|
+
Object.entries(mcpTools).map(([name, mcpTool]) => {
|
|
266
|
+
const annotations = (mcpTool.metadata as McpProviderMetadata | undefined)
|
|
267
|
+
?.annotations;
|
|
268
|
+
|
|
269
|
+
return [
|
|
270
|
+
name,
|
|
271
|
+
{
|
|
272
|
+
...mcpTool,
|
|
273
|
+
needsApproval: annotations?.readOnlyHint !== true,
|
|
274
|
+
},
|
|
275
|
+
];
|
|
276
|
+
}),
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
const result = streamText({
|
|
280
|
+
model: __MODEL__,
|
|
281
|
+
tools,
|
|
282
|
+
prompt,
|
|
283
|
+
});
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
See the
|
|
287
|
+
[local tool annotations example](https://github.com/vercel/ai/tree/main/examples/mcp/src/tool-annotations)
|
|
288
|
+
for a complete annotated MCP server and application-layer approval
|
|
289
|
+
configuration. Start the server and client in separate terminals:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
cd examples/mcp
|
|
293
|
+
pnpm server:tool-annotations
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
cd examples/mcp
|
|
298
|
+
pnpm client:tool-annotations
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Ask the client to read, delete, or create a note. The read-only tool executes
|
|
302
|
+
immediately. The destructive and unannotated tools prompt for approval; after
|
|
303
|
+
you enter `y` or `n`, the client sends the decision back and prints the model's
|
|
304
|
+
response.
|
|
305
|
+
|
|
243
306
|
### Schema Definition
|
|
244
307
|
|
|
245
308
|
For better type safety and control, you can define the tools and their input schemas explicitly in your client code:
|
|
@@ -21,21 +21,6 @@ const audio = await generateSpeech({
|
|
|
21
21
|
});
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
### Language Setting
|
|
25
|
-
|
|
26
|
-
You can specify the language for speech generation (provider support varies):
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
import { experimental_generateSpeech as generateSpeech } from 'ai';
|
|
30
|
-
import { lmnt } from '@ai-sdk/lmnt';
|
|
31
|
-
|
|
32
|
-
const audio = await generateSpeech({
|
|
33
|
-
model: lmnt.speech('aurora'),
|
|
34
|
-
text: 'Hola, mundo!',
|
|
35
|
-
language: 'es', // Spanish
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
24
|
To access the generated audio:
|
|
40
25
|
|
|
41
26
|
```ts
|
|
@@ -163,8 +148,6 @@ try {
|
|
|
163
148
|
| [ElevenLabs](/providers/ai-sdk-providers/elevenlabs#speech-models) | `eleven_flash_v2` |
|
|
164
149
|
| [ElevenLabs](/providers/ai-sdk-providers/elevenlabs#speech-models) | `eleven_turbo_v2_5` |
|
|
165
150
|
| [ElevenLabs](/providers/ai-sdk-providers/elevenlabs#speech-models) | `eleven_turbo_v2` |
|
|
166
|
-
| [LMNT](/providers/ai-sdk-providers/lmnt#speech-models) | `aurora` |
|
|
167
|
-
| [LMNT](/providers/ai-sdk-providers/lmnt#speech-models) | `blizzard` |
|
|
168
151
|
| [Hume](/providers/ai-sdk-providers/hume#speech-models) | `default` |
|
|
169
152
|
| [Fish Audio](/providers/ai-sdk-providers/fish-audio#speech-models) | `s1` |
|
|
170
153
|
| [Fish Audio](/providers/ai-sdk-providers/fish-audio#speech-models) | `s2-pro` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.278",
|
|
4
4
|
"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.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@opentelemetry/api": "^1.9.0",
|
|
48
|
-
"@ai-sdk/gateway": "3.0.
|
|
48
|
+
"@ai-sdk/gateway": "3.0.190",
|
|
49
49
|
"@ai-sdk/provider": "3.0.15",
|
|
50
50
|
"@ai-sdk/provider-utils": "4.0.50"
|
|
51
51
|
},
|