Vercel has updated its AI SDK, with changes released across multiple packages. The @ai-sdk/zai@2.0.2 release introduces a mechanism to reject generateText responses that do not satisfy required or specifically selected tool choices. This update also exposes normalized response content on ToolChoiceViolationError for optional recovery.
Further updates in @ai-sdk/zai@3.0.2 expose parsed structured output in streamText end callbacks. The @ai-sdk/tui@1.0.86 and @ai-sdk/svelte@5.0.85 releases include fixes for summing Gateway image-generation costs across split requests and exposing individual image generation calls.
Key Points
- The @ai-sdk/zai@2.0.2 release rejects
generateTextresponses that do not meet tool choice requirements. - Normalized response content is now exposed on
ToolChoiceViolationErrorfor opt-in recovery in @ai-sdk/zai@2.0.2. - Tool approval secrets are allowed in
ToolLoopAgentsettings andprepareCallin @ai-sdk/zai@2.0.2 and @ai-sdk/zai@3.0.2. - Assistant messages are omitted when only cache points remain after unsigned reasoning is filtered in @ai-sdk/amazon-bedrock@4.0.166 and @ai-sdk/amazon-bedrock@5.0.67.
- A model family setting for embeddings to support ARN has been added to @ai-sdk/amazon-bedrock@4.0.166 and @ai-sdk/amazon-bedrock@5.0.67.
- @ai-sdk/amazon-bedrock@5.0.68 enables Anthropic reasoning budgets for application inference profile ARNs.
- @ai-sdk/zai@3.0.2 exposes parsed structured output in
streamTextend callbacks.
Context
According to the Vercel AI SDK Changelog, these updates are part of ongoing development to refine the SDK's functionality and provider integrations. The changes address specific behaviors related to tool usage, error handling, and cost calculation within the SDK.
Why It Matters
These updates provide developers with more control over tool interactions and error recovery, particularly when integrating with models that support tool use. Enhanced support for Amazon Bedrock features, such as embedding model family settings and reasoning budgets, can improve the flexibility and efficiency of applications built on the Vercel AI SDK.
What To Do
- Review the updated documentation for
ToolChoiceViolationErrorto understand new recovery options. - Test
generateTextresponses with required tool choices to observe the new rejection behavior. - Developers using Amazon Bedrock should explore the new model family setting for embeddings.
- Note the exposure of parsed structured output in
streamTextend callbacks for @ai-sdk/zai@3.0.2.
