Sanity AI Assist: New Features and Breaking Changes Including Content Translation, Image Generation, and Improved Field Support
Published: February 13, 2024
✨ Highlights
Sanity AI Assist 2.0 comes with new features and breaking changes that bring consistency to the plugin's configuration.
Paid feature
This article is about a feature currently available for all projects on the Growth plan and up.
To upgrade to the latest version of AI Assist:
npm install sanity@latest @sanity/assist@latestpnpm add sanity@latest @sanity/assist@latestyarn add sanity@latest @sanity/assist@latestbun add sanity@latest @sanity/assist@latestContent translation
Sanity AI Assist can now translate localized content with a simple action. Built to support the localization models used by the Document Internationalization and Internationalized Array plugins.
Image generation
You can now instruct AI Assist to generate images for image fields. It also supports a two-step process where you instruct AI Assist to generate an instruction for image generation for better results.
Image description support
AI Assist can now add image descriptions to an image field. This is useful for generating alternative text and image captions. AI Assist will automatically run when an image is uploaded and replaced.
Reference field support
AI Assist can now work with reference fields to pull in content that's described in an instruction. Requires setting up an Embeddings Index for documents you wish to refer to.
Other improvements
- You can now explicitly filter what fields an instruction is allowed to interact with
- Support for conditionally
hiddenandreadOnlyfields - Image generation instruction will always show when enabled
- Translation actions will be disabled if AI Assist is not initialized
- AI context blocks are now always visible in the instruction editor
Migrating breaking changes
AI Assist's schema option properties have changed and been moved into a common namespace (aiAssist). Some configuration properties have been renamed for clarity.
All AI Assist schema options now live under options.aiAssist:
options.aiWritingAssistance.exclude->options.aiAssist.excludeoptions.aiWritingAssistance.embeddingsIndex options.aiAssist.embeddingsIndexoptions.aiWritingAssistance.translateAction->options.aiAssist.translateActionoptions.imagePromptField->options.aiAssist.imageInstructionFieldoptions.captionField
Related documentation
Install and configure Sanity AI Assist
How to install and configure the AI Assist plugin for Sanity Studio.
Content translation with AI Assist
How to set up and use AI Assist for content translations for documents and fields.
Common instructions for AI Assist
Instruction cheat sheet with common tasks that can be adapted to your specific use case.
Create and run instructions with AI Assist
How to create, run, and work with instructions for Sanity AI Assist.
Embeddings index introduction (deprecated)
Embeddings allow you to search for what your documents are about. Use the Embeddings Index API to build LLM agents or to enable semantic search.