@sanity/assist 1.0.11 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,7 +40,7 @@ In your Studio project folder, install the following plugin dependency:
40
40
  npm install @sanity/assist sanity@latest
41
41
  ```
42
42
 
43
- This plugin requires `sanity` version `3.13.0` or greater.
43
+ This plugin requires `sanity` version `3.14.5` or greater.
44
44
 
45
45
  ## Setup
46
46
 
@@ -200,6 +200,33 @@ but some common caveats to the field that you may run into using AI Assist are:
200
200
  * Timeouts: To be able to write structured content, we're using the largest language models - long-running results may time out or intermittently fail
201
201
  * Limited capacity: The underlying LLM APIs used by AI Assist are resource constrained
202
202
 
203
+ ## Other features
204
+
205
+ ### Caption generation
206
+ AI Assist can optionally generate captions for images. This has to be enabled on an image-type/field,
207
+ by setting the `options.captionField` on the image type, where `captionField` is the field name of a
208
+ custom string-field on the image object:
209
+
210
+ ```tsx
211
+ defineField({
212
+ type: 'image',
213
+ name: 'inlineImage',
214
+ title: 'Image',
215
+ fields: [
216
+ defineField({
217
+ type: 'string',
218
+ name: 'caption',
219
+ title: 'Caption',
220
+ }),
221
+ ],
222
+ options: {
223
+ captionField: 'caption',
224
+ },
225
+ }),
226
+ ```
227
+ This will add a "Generate caption" action to the configured field.
228
+ "Generate caption" action will automatically run whenever the image changes.
229
+
203
230
  ## License
204
231
 
205
232
  [MIT](LICENSE) © Sanity
package/dist/index.d.ts CHANGED
@@ -40,6 +40,7 @@ declare module 'sanity' {
40
40
  interface GeopointOptions extends AssistOptions {}
41
41
  interface ImageOptions extends AssistOptions {
42
42
  imagePromptField?: string
43
+ captionField?: string
43
44
  }
44
45
  interface NumberOptions extends AssistOptions {}
45
46
  interface ObjectOptions extends AssistOptions {}