ai 7.0.146 → 7.0.147

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +3 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/internal/index.js +1 -1
  6. package/docs/02-foundations/01-overview.mdx +1 -1
  7. package/docs/02-foundations/02-providers-and-models.mdx +2 -2
  8. package/docs/02-foundations/03-prompts.mdx +3 -3
  9. package/docs/02-foundations/04-tools.mdx +2 -2
  10. package/docs/02-getting-started/00-choosing-a-provider.mdx +1 -1
  11. package/docs/02-getting-started/02-nextjs-app-router.mdx +4 -4
  12. package/docs/02-getting-started/03-nextjs-pages-router.mdx +4 -4
  13. package/docs/02-getting-started/04-svelte.mdx +3 -3
  14. package/docs/02-getting-started/05-nuxt.mdx +3 -3
  15. package/docs/02-getting-started/06-nodejs.mdx +2 -2
  16. package/docs/02-getting-started/07-expo.mdx +4 -4
  17. package/docs/02-getting-started/08-tanstack-start.mdx +4 -4
  18. package/docs/03-ai-sdk-core/10-generating-structured-data.mdx +1 -1
  19. package/docs/03-ai-sdk-core/18-tools.mdx +5 -5
  20. package/docs/03-ai-sdk-core/37-speech.mdx +1 -1
  21. package/docs/03-ai-sdk-core/41-skill-uploads.mdx +24 -10
  22. package/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +1 -1
  23. package/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +5 -5
  24. package/docs/03-ai-sdk-harnesses/06-workflow-utilities.mdx +12 -0
  25. package/docs/03-ai-sdk-harnesses/07-ui.mdx +2 -2
  26. package/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +2 -2
  27. package/docs/05-ai-sdk-rsc/01-overview.mdx +1 -1
  28. package/docs/05-ai-sdk-rsc/10-migrating-to-ui.mdx +1 -1
  29. package/docs/06-advanced/01-prompt-engineering.mdx +1 -1
  30. package/docs/06-advanced/03-backpressure.mdx +1 -1
  31. package/docs/06-advanced/10-vercel-deployment-guide.mdx +1 -1
  32. package/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +1 -1
  33. package/docs/07-reference/01-ai-sdk-core/14-upload-skill.mdx +3 -3
  34. package/docs/07-reference/01-ai-sdk-core/22-dynamic-tool.mdx +1 -1
  35. package/docs/08-migration-guides/index.mdx +12 -12
  36. package/docs/09-troubleshooting/05-tool-invocation-missing-result.mdx +1 -1
  37. package/package.json +2 -2
  38. package/src/generate-text/output.ts +1 -1
  39. package/src/ui/process-ui-message-stream.ts +1 -0
@@ -17,7 +17,7 @@ const { providerReference } = await uploadSkill({
17
17
  files: [
18
18
  {
19
19
  path: 'my-skill/SKILL.md',
20
- content: readFileSync('./SKILL.md'),
20
+ data: readFileSync('./SKILL.md'),
21
21
  },
22
22
  ],
23
23
  displayTitle: 'My Skill',
@@ -42,9 +42,9 @@ const { providerReference } = await uploadSkill({
42
42
  },
43
43
  {
44
44
  name: 'files',
45
- type: 'SkillsV4File[]',
45
+ type: 'UploadSkillFile[]',
46
46
  description:
47
- 'The files that make up the skill. Each file has a relative `path` and `content` (either a `Uint8Array` or a base64-encoded string).',
47
+ "The files that make up the skill. Each file must have a relative `path` and `data`. The `data` can be a string, a `Uint8Array`, or an object with `type: 'text'` and a string `text` value, or `type: 'data'` and a string `data` value.",
48
48
  },
49
49
  {
50
50
  name: 'displayTitle',
@@ -224,7 +224,7 @@ When used with useChat (`UIMessage` format), dynamic tools appear as `dynamic-to
224
224
  switch (part.type) {
225
225
  case 'dynamic-tool':
226
226
  return (
227
- <div>
227
+ <div key={part.toolCallId}>
228
228
  <h4>Tool: {part.toolName}</h4>
229
229
  <pre>{JSON.stringify(part.input, null, 2)}</pre>
230
230
  </div>
@@ -6,18 +6,18 @@ collapsed: true
6
6
 
7
7
  # Migration Guides
8
8
 
9
- - [ Migrate AI SDK 6.x to 7.0 ](/docs/migration-guides/migration-guide-7-0)
10
- - [ Migrate AI SDK 5.x to 6.0 ](/docs/migration-guides/migration-guide-6-0)
11
- - [ Migrate AI SDK 4.x to 5.0 ](/docs/migration-guides/migration-guide-5-0)
12
- - [ Migrate your data to AI SDK 5.0 ](/docs/migration-guides/migration-guide-5-0-data)
13
- - [ Migrate AI SDK 4.1 to 4.2 ](/docs/migration-guides/migration-guide-4-2)
14
- - [ Migrate AI SDK 4.0 to 4.1 ](/docs/migration-guides/migration-guide-4-1)
15
- - [ Migrate AI SDK 3.4 to 4.0 ](/docs/migration-guides/migration-guide-4-0)
16
- - [ Migrate AI SDK 3.3 to 3.4 ](/docs/migration-guides/migration-guide-3-4)
17
- - [ Migrate AI SDK 3.2 to 3.3 ](/docs/migration-guides/migration-guide-3-3)
18
- - [ Migrate AI SDK 3.1 to 3.2 ](/docs/migration-guides/migration-guide-3-2)
19
- - [ Migrate AI SDK 3.0 to 3.1 ](/docs/migration-guides/migration-guide-3-1)
9
+ - [Migrate AI SDK 6.x to 7.0](/docs/migration-guides/migration-guide-7-0)
10
+ - [Migrate AI SDK 5.x to 6.0](/docs/migration-guides/migration-guide-6-0)
11
+ - [Migrate AI SDK 4.x to 5.0](/docs/migration-guides/migration-guide-5-0)
12
+ - [Migrate your data to AI SDK 5.0](/docs/migration-guides/migration-guide-5-0-data)
13
+ - [Migrate AI SDK 4.1 to 4.2](/docs/migration-guides/migration-guide-4-2)
14
+ - [Migrate AI SDK 4.0 to 4.1](/docs/migration-guides/migration-guide-4-1)
15
+ - [Migrate AI SDK 3.4 to 4.0](/docs/migration-guides/migration-guide-4-0)
16
+ - [Migrate AI SDK 3.3 to 3.4](/docs/migration-guides/migration-guide-3-4)
17
+ - [Migrate AI SDK 3.2 to 3.3](/docs/migration-guides/migration-guide-3-3)
18
+ - [Migrate AI SDK 3.1 to 3.2](/docs/migration-guides/migration-guide-3-2)
19
+ - [Migrate AI SDK 3.0 to 3.1](/docs/migration-guides/migration-guide-3-1)
20
20
 
21
21
  ## Versioning
22
22
 
23
- - [ Versioning ](/docs/migration-guides/versioning)
23
+ - [Versioning](/docs/migration-guides/versioning)
@@ -38,7 +38,7 @@ const tools = {
38
38
  };
39
39
  ```
40
40
 
41
- 2. Client-side execution with `useChat` (omitting the `execute` function), you must provide results using `addToolOutput`:
41
+ 2. For client-side execution with `useChat` (omitting the `execute` function), you must provide results using `addToolOutput`:
42
42
 
43
43
  ```tsx
44
44
  import { useChat } from '@ai-sdk/react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "7.0.146",
3
+ "version": "7.0.147",
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.119",
45
+ "@ai-sdk/gateway": "4.0.120",
46
46
  "@ai-sdk/provider": "4.0.31",
47
47
  "@ai-sdk/provider-utils": "5.0.64"
48
48
  },
@@ -491,7 +491,7 @@ function getArrayLengthValidationError({
491
491
 
492
492
  /**
493
493
  * Output specification for choice generation.
494
- * When the model generates a text response, it will return a one of the choice options.
494
+ * When the model generates a text response, it will return one of the choice options.
495
495
  *
496
496
  * @param options - The available choices.
497
497
  * @param name - Optional name of the output that should be generated. Used by some providers for additional LLM guidance, e.g. via tool or schema name.
@@ -271,6 +271,7 @@ export function processUIMessageStream<UI_MESSAGE extends UIMessage>({
271
271
 
272
272
  if (part != null) {
273
273
  part.state = options.state;
274
+ anyPart.type = `tool-${options.toolName}`;
274
275
  anyPart.input = anyOptions.input;
275
276
  anyPart.output = anyOptions.output;
276
277
  anyPart.errorText = anyOptions.errorText;