Vercel AI SDK, in its @ai-sdk/xai@4.0.26 release, has added asynchronous APIs for the VideoModelV4 interface. This update, released on August 3, 2024, introduces a start/status flow for video generation, enabling models to implement doStart, doStatus, and handleWebhookOption.
These new capabilities allow the experimental_generateVideo function to accept poll and webhook options, facilitating completion orchestration through either polling or webhooks. Polling configurations can also utilize a custom delay implementation for compatibility with durable workflows.
Key Points
- The @ai-sdk/xai@4.0.26 release introduces asynchronous APIs for video generation.
- The VideoModelV4 interface now supports
doStart,doStatus, andhandleWebhookOption. experimental_generateVideoacceptspollandwebhookoptions for completion orchestration.- Polling configurations can include a custom delay implementation for durable workflow compatibility.
- This update was released on August 3, 2024.
- The @ai-sdk/xai@3.0.114 release, also on August 3, 2024, addressed an issue where video generation would hang during status polling.
Context
According to the Vercel AI SDK Changelog, the asynchronous APIs enhance the experimental video model interface. A previous release, @ai-sdk/xai@3.0.114, fixed a bug where video generation would hang while polling status, indicating ongoing development and refinement of video generation capabilities within the SDK.
Why It Matters
This update provides developers with more flexible and robust methods for integrating video generation into applications, particularly for long-running processes that benefit from asynchronous handling and status monitoring.
What To Do
- Review the @ai-sdk/xai@4.0.26 release notes for detailed implementation specifics.
- Explore the
doStart,doStatus, andhandleWebhookOptionmethods for custom video model implementations. - Test the
pollandwebhookoptions withexperimental_generateVideofor asynchronous workflows. - Note the custom delay implementation for polling, especially for durable workflow scenarios.
