The Vercel AI SDK has released version 3.0.32 of its @ai-sdk/moonshotai provider. This update introduces a dedicated chat implementation for MoonshotAI and expands its capabilities to include video input.
Key Points
- The @ai-sdk/moonshotai provider now owns its chat implementation, moving away from @ai-sdk/openai-compatible.
- Video file parts, such as
mediaType: 'video/mp4', are converted to Moonshot'svideo_urlcontent parts. - This video input support is available for Moonshot's video-capable models: kimi-k3, kimi-k2.7-code, kimi-k2.6, and kimi-k2.5.
- Audio and PDF file parts are now rejected client-side by the provider.
- The
reasoningHistory: 'preserved'setting now maps to Moonshot'sthinking.keep: 'all'request field. - New provider options include
promptCacheKeyandsafetyIdentifier. - The
reasoningEffortoption now accepts'low','high', or'max', aligning with Moonshot's documentation.
Context
According to the Vercel AI SDK Changelog, this update signifies a shift for the MoonshotAI provider to manage its core functionalities directly. This includes the converter, language model, and helper utilities, which are now owned by the package itself. The change also refines how certain API parameters are handled, such as reasoningHistory and reasoningEffort, to better align with Moonshot's native API.
Why It Matters
This update enhances the Vercel AI SDK's integration with MoonshotAI, particularly for developers working with multimodal applications. The direct support for video input and the refined handling of API parameters can streamline development workflows and enable new use cases for Moonshot's video-capable models.
What To Do
- Developers using the @ai-sdk/moonshotai provider should update to version 3.0.32.
- Review the updated documentation for handling video input with models like kimi-k3.
- Note that audio and PDF file parts are no longer supported and will cause client-side rejections.
- Explore the new
promptCacheKeyandsafetyIdentifierprovider options for potential application.