Vercel AI SDK has announced an update promoting the repairText option to stable status within its generateObject and streamObject functions. This change, part of the ai@7.0.39 release, also introduces experimental_repairText as a deprecated alias to ensure backward compatibility for existing implementations.
Key Points
- The
repairTextoption is now stable forgenerateObjectandstreamObjectfunctions. - A deprecated
experimental_repairTextalias has been introduced for backward compatibility. - This update is included in the
ai@7.0.39release. - Dependencies for
@ai-sdk/provider-utils@5.0.14,@ai-sdk/gateway@4.0.30,@ai-sdk/alibaba@2.0.18,@ai-sdk/openai-compatible@3.0.16,@ai-sdk/amazon-bedrock@5.0.34,@ai-sdk/openai@4.0.22, and@ai-sdk/anthropic@4.0.23were updated. - Specific packages like
@ai-sdk/svelte@5.0.39,@ai-sdk/tui@1.0.40,@ai-sdk/valibot@3.0.14, and@ai-sdk/vercel@3.0.16also received patch changes.
Context
According to the Vercel AI SDK changelog, this promotion signifies a maturation of the repairText functionality, making it a standard feature for developers working with object generation and streaming. The inclusion of a deprecated alias suggests a phased transition to the new stable option, allowing developers time to update their codebases without immediate breakage.
Why It Matters
This update provides developers with a stable and officially supported method for text repair during object generation and streaming, potentially improving the reliability and robustness of applications built with the Vercel AI SDK. The backward-compatible alias helps maintain continuity for existing projects.
What To Do
- Review existing codebases for usage of
experimental_repairText. - Update implementations to use the stable
repairTextoption forgenerateObjectandstreamObject. - Note the updated dependency versions for various
@ai-sdkpackages. - Check the Vercel AI SDK documentation for further details on the
repairTextoption.
