-
Notifications
You must be signed in to change notification settings - Fork 4
AI Assist - Generate Image Description Behavior Issue #660
Description
Found a behavior issue with the native AI Assist - Generate Image Description. When initially updating the field while it's empty, the AI Assist is working correctly. Once I publish and click the Generate Image Description - AI Assist again, an error appears. It only works again when you empty the alt field.
Steps to reproduce the behavior:
- In your Sanity Intance, AI Assist should be enabled
- In a document add the following code field
defineField({
name: 'featuredImage',
title: 'Featured Image',
type: 'image',
group: 'editorial',
fields: [
defineField({
type: 'string',
name: 'alt',
title: 'Alternative text',
}),
defineField({
type: 'url',
name: 'href_url',
title: 'Image Link',
validation: Rule => Rule.uri({
scheme: ['http', 'https'],
}),
}),
],
options: {
hotspot: true,
aiAssist: {
imageDescriptionField: 'alt',
},
},
}),
- Upload an image and the initial AI Image Description generation should be executed automatically
- Publish the document
- Hover back to the alt field and click AI Assist > Generate Image Description
- An error will occur
- Empty the alt field and go back to step 5 again, it should work
Issue is in step 6
Screenshots
If applicable, add screenshots to help explain your problem.
ai-assist-issue.mp4
Which versions of Sanity are you using?
@sanity/cli (global) 5.11.0 (up to date)
@sanity/asset-utils 2.3.0 (up to date)
@sanity/assist 5.0.4 (up to date)
@sanity/cli 5.11.0 (up to date)
@sanity/color-input 6.0.3 (latest: 6.0.4)
@sanity/document-internationalization 4.1.1 (latest: 5.0.2)
@sanity/eslint-config-studio 6.0.0 (up to date)
@sanity/icons 3.7.4 (up to date)
@sanity/table 2.0.1 (up to date)
@sanity/ui 3.1.11 (up to date)
@sanity/vision 5.11.0 (up to date)
sanity 5.11.0 (up to date)
What operating system are you using?
Macos 15.1.1
Which versions of Node.js / npm are you running?
npm -v && node -v
10.9.2
v22.13.0