docs: add AI SDK 7 Beta announcement and rebrand Workflow references#14520
docs: add AI SDK 7 Beta announcement and rebrand Workflow references#14520nicoalbanese wants to merge 20 commits intomainfrom
Conversation
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
|
|
||
| ### Stable Typed Tool Context | ||
|
|
||
| AI SDK 7 promotes `experimental_context` to stable `context` and lets tools declare a `contextSchema` for end-to-end type inference. |
There was a problem hiding this comment.
This was just enhanced in #14515, may be good to mention that context is separated by tool and must be passed via toolsContext.
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
|
|
||
| ### Overhauled Telemetry | ||
|
|
||
| AI SDK 7 overhauls telemetry to make observability much easier to adopt. OpenTelemetry support now lives in the new `@ai-sdk/otel` package, and setup is simple: register an integration once, then enable telemetry on the calls you want to trace. |
There was a problem hiding this comment.
then enable telemetry on the calls you want to trace.
this will change after PR #14500.
Telemetry will be enabled by default for all calls and will opt-out!
| const result = streamText({ | ||
| model: __MODEL__, | ||
| prompt: "Summarize today's release notes.", | ||
| experimental_telemetry: { isEnabled: true }, |
There was a problem hiding this comment.
this line won't be needed!
| import { GenAIOpenTelemetryIntegration } from '@ai-sdk/otel'; | ||
| __PROVIDER_IMPORT__; | ||
|
|
||
| registerTelemetryIntegration(new GenAIOpenTelemetryIntegration()); |
There was a problem hiding this comment.
would be good to mention that this only needs to happen on app startup
| __PROVIDER_IMPORT__; | ||
| import { z } from 'zod'; | ||
|
|
||
| export const supportAgent = new WorkflowAgent({ | ||
| model: __MODEL__, |
There was a problem hiding this comment.
I think I would use an example provider here. Being able to use the providers just like ToolLoopAgent is one of the main improvements over DurableAgent
| __PROVIDER_IMPORT__; | |
| import { z } from 'zod'; | |
| export const supportAgent = new WorkflowAgent({ | |
| model: __MODEL__, | |
| import { openai } from '@ai-sdk/openai'; | |
| import { z } from 'zod'; | |
| export const supportAgent = new WorkflowAgent({ | |
| model: openai('gpt-5.4-pro'), |
| execute: async ({ orderId }) => ({ | ||
| orderId, | ||
| status: 'shipped', | ||
| }), |
There was a problem hiding this comment.
this would usually be a step function.
| execute: async ({ orderId }) => ({ | |
| orderId, | |
| status: 'shipped', | |
| }), | |
| execute: async ({ orderId }) => { | |
| 'use step'; | |
| /* look up order in database */ | |
| return { | |
| orderId, | |
| status: 'shipped', | |
| } | |
| }, |
| ### Stable Typed Tool Context | ||
|
|
||
| AI SDK 7 promotes `experimental_context` to stable `context` and lets each tool declare its own `contextSchema` for end-to-end type inference. Context is separated by tool — each tool only receives the context it declares, and the call-site `context` is type-checked against the combined requirements of all tools. | ||
|
|
||
| ```ts | ||
| import { tool } from 'ai'; | ||
| import { z } from 'zod'; | ||
|
|
||
| const weather = tool({ | ||
| inputSchema: z.object({ | ||
| location: z.string(), | ||
| }), | ||
| contextSchema: z.object({ | ||
| weatherApiKey: z.string(), | ||
| }), | ||
| execute: async ({ location }, { context: { weatherApiKey } }) => { | ||
| return getWeather(location, weatherApiKey); | ||
| }, | ||
| }); | ||
| ``` | ||
|
|
||
| This typed context also flows into approval callbacks and other tool lifecycle hooks. See the [migration guide](/docs/migration-guides/migration-guide-7-0) for upgrade details. |
There was a problem hiding this comment.
this is still undergoing significant changes (example is already outdated)
| ### `reasoning-file` Content Part | ||
|
|
||
| Models that return files as part of their reasoning trace (separate from regular output files) now use a distinct `reasoning-file` content part type. Previously these were grouped under the generic `file` type. If you have exhaustive part handling (`switch` statements, renderers, serializers), you will need to add a case for `type: 'reasoning-file'`. | ||
|
|
There was a problem hiding this comment.
there is also the new top level toolNeedsApproval setting for agent, generateText, streamText
There was a problem hiding this comment.
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Co-Authored-By: open-agents-bot[bot] <260704009+open-agents-bot[bot]@users.noreply.github.com>
Summary
Add AI SDK 7 Beta announcement page with comprehensive documentation on new features, update Workflow-related docs to reference the Workflow SDK instead of Vercel Workflows, and replace hardcoded model names with placeholders in code examples.
Changes
New: AI SDK 7 Beta announcement (
content/docs/00-introduction/01-announcing-ai-sdk-7-beta.mdx)Introduction page (
content/docs/00-introduction/index.mdx)Migration guides (
content/docs/08-migration-guides/index.mdx)Rebrand: Vercel Workflows -> Workflow SDK (across 7 files)
content/docs/03-agents/07-workflow-agent.mdx— Update description, comparison table, and runtime referencescontent/docs/03-agents/index.mdx— Update WorkflowAgent card descriptioncontent/docs/04-ai-sdk-ui/21-transport.mdx— Update Workflow Transport sectioncontent/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx— Update class description and reference textcontent/docs/07-reference/04-ai-sdk-workflow/02-workflow-chat-transport.mdx— Update transport descriptioncontent/docs/07-reference/04-ai-sdk-workflow/index.mdx— Update package overviewCode example cleanup
__MODEL__and__PROVIDER_IMPORT__placeholders in announcement page examplesChat - Built with guidance from Nico Albanese