ai 6.0.0-beta.99 → 6.0.1

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # AI SDK
4
4
 
5
- The [AI SDK](https://ai-sdk.dev/docs) is a TypeScript toolkit designed to help you build AI-powered applications and agents using popular frameworks like Next.js, React, Svelte, Vue and runtimes like Node.js.
5
+ The [AI SDK](https://ai-sdk.dev/docs) is a provider-agnostic TypeScript toolkit designed to help you build AI-powered applications and agents using popular UI frameworks like Next.js, React, Svelte, Vue, Angular, and runtimes like Node.js.
6
6
 
7
7
  To learn more about how to use the AI SDK, check out our [API Reference](https://ai-sdk.dev/docs/reference) and [Documentation](https://ai-sdk.dev/docs).
8
8
 
@@ -50,16 +50,20 @@ const { text } = await generateText({
50
50
  ### Generating Structured Data
51
51
 
52
52
  ```ts
53
- import { generateObject } from 'ai';
53
+ import { generateText, Output } from 'ai';
54
54
  import { z } from 'zod';
55
55
 
56
- const { object } = await generateObject({
57
- model: 'openai/gpt-4.1',
58
- schema: z.object({
59
- recipe: z.object({
60
- name: z.string(),
61
- ingredients: z.array(z.object({ name: z.string(), amount: z.string() })),
62
- steps: z.array(z.string()),
56
+ const { output } = await generateText({
57
+ model: 'openai/gpt-5',
58
+ output: Output.object({
59
+ schema: z.object({
60
+ recipe: z.object({
61
+ name: z.string(),
62
+ ingredients: z.array(
63
+ z.object({ name: z.string(), amount: z.string() }),
64
+ ),
65
+ steps: z.array(z.string()),
66
+ }),
63
67
  }),
64
68
  }),
65
69
  prompt: 'Generate a lasagna recipe.',
@@ -72,10 +76,10 @@ const { object } = await generateObject({
72
76
  import { ToolLoopAgent } from 'ai';
73
77
 
74
78
  const sandboxAgent = new ToolLoopAgent({
75
- model: 'openai/gpt-5-codex',
79
+ model: 'openai/gpt-5',
76
80
  system: 'You are an agent with access to a shell environment.',
77
81
  tools: {
78
- local_shell: openai.tools.localShell({
82
+ shell: openai.tools.localShell({
79
83
  execute: async ({ action }) => {
80
84
  const [cmd, ...args] = action.command;
81
85
  const sandbox = await getSandbox(); // Vercel Sandbox
@@ -106,7 +110,7 @@ import { ToolLoopAgent, InferAgentUIMessage } from 'ai';
106
110
  export const imageGenerationAgent = new ToolLoopAgent({
107
111
  model: openai('gpt-5'),
108
112
  tools: {
109
- image_generation: openai.tools.imageGeneration({
113
+ generateImage: openai.tools.imageGeneration({
110
114
  partialImages: 3,
111
115
  }),
112
116
  },
@@ -182,7 +186,7 @@ export default function Page() {
182
186
  switch (part.type) {
183
187
  case 'text':
184
188
  return <div key={index}>{part.text}</div>;
185
- case 'tool-image_generation':
189
+ case 'tool-generateImage':
186
190
  return <ImageGenerationView key={index} invocation={part} />;
187
191
  }
188
192
  })}