@sanity/assist 6.1.20 → 6.2.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 +4 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +363 -256
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -180,6 +180,7 @@ assist({
|
|
|
180
180
|
assist: {
|
|
181
181
|
localeSettings: () => Intl.DateTimeFormat().resolvedOptions(),
|
|
182
182
|
maxPathDepth: 4,
|
|
183
|
+
maxFieldSelectionDepth: 6,
|
|
183
184
|
temperature: 0.3,
|
|
184
185
|
},
|
|
185
186
|
translate: {/* see sections about document and field translation */},
|
|
@@ -188,6 +189,7 @@ assist({
|
|
|
188
189
|
|
|
189
190
|
- `localeSettings`: See section on [date and datetime](#date-and-datetime)
|
|
190
191
|
- `maxPathDepth`: The max depth for document paths AI Assist will write to.
|
|
192
|
+
- `maxFieldSelectionDepth`: The max depth for fields that can be selected for AI Assist. Fields nested deeper than this get no AI Assist field action, are not listed in the field picker when editing instructions, and cannot be referenced from an instruction. Depth is counted in path segments from the document root (`title` has depth 1, `array[_key="no"].title` has depth 3). Be careful not to set this too high in studios with recursive document schemas, as it could have negative impact on performance.
|
|
191
193
|
- `temperature`: Influences how much the output of an instruction will vary between runs.
|
|
192
194
|
|
|
193
195
|
For more details, please review the TSDocs of the individual config parameters in [assistTypes.ts](./src/assistTypes.ts).
|
|
@@ -658,6 +660,8 @@ assist({
|
|
|
658
660
|
Be careful not to set this too high in studios with recursive document schemas, as it could have negative impact on performance.
|
|
659
661
|
maxPathDepth is hard-capped to 50.
|
|
660
662
|
|
|
663
|
+
`translate.field.maxPathDepth` only affects the "Translate fields" action. Which fields get an AI Assist field action at all is controlled by `assist.maxFieldSelectionDepth` (see [Assist configuration](#assist-configuration-optional)).
|
|
664
|
+
|
|
661
665
|
### Loading field languages
|
|
662
666
|
|
|
663
667
|
Languages must be an array of objects with an id and title.
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,23 @@ interface AssistConfig {
|
|
|
37
37
|
* Default: 4
|
|
38
38
|
*/
|
|
39
39
|
maxPathDepth?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The max depth for fields that can be selected for AI Assist in the Studio: fields deeper than this
|
|
42
|
+
* get no AI Assist field action (the sparkle button), are not listed in the field picker when editing
|
|
43
|
+
* instructions, and cannot be referenced from an instruction prompt.
|
|
44
|
+
*
|
|
45
|
+
* Depth is based on field path segments, counted from the document root:
|
|
46
|
+
* - `title` has depth 1
|
|
47
|
+
* - `array[_key="no"].title` has depth 3
|
|
48
|
+
*
|
|
49
|
+
* Unlike `maxPathDepth`, this does not affect what an instruction can write to once it runs.
|
|
50
|
+
*
|
|
51
|
+
* Be careful not to set this too high in studios with recursive document schemas, as it could have
|
|
52
|
+
* negative impact on performance.
|
|
53
|
+
*
|
|
54
|
+
* Default: 6
|
|
55
|
+
*/
|
|
56
|
+
maxFieldSelectionDepth?: number;
|
|
40
57
|
/**
|
|
41
58
|
* Influences how much the output of an instruction will vary.
|
|
42
59
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/assistTypes.ts","../src/fieldActions/customFieldActions.tsx","../src/translate/types.ts","../src/types.ts","../src/plugin.tsx","../src/schemas/serialize/SchemTypeTool.tsx","../src/schemas/typeDefExtensions.ts","../src/translate/paths.ts","../src/fieldActions/useUserInput.ts","../src/helpers/typeUtils.ts"],"mappings":";;;;UAEiB;;;;;;;;;;;;;;;;;;EAkBf,kBAAkB,SAAS,0BAA0B;;;;;;;;;;;;;;;;EAiBrD;;;;;;;;;;;;;EAcA;;UAGe;EACf,MAAM;EACN,iBAAiB;;UAGF;;;;;;;;;;EAUf;;;;;;;;;;;EAYA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/assistTypes.ts","../src/fieldActions/customFieldActions.tsx","../src/translate/types.ts","../src/types.ts","../src/plugin.tsx","../src/schemas/serialize/SchemTypeTool.tsx","../src/schemas/typeDefExtensions.ts","../src/translate/paths.ts","../src/fieldActions/useUserInput.ts","../src/helpers/typeUtils.ts"],"mappings":";;;;UAEiB;;;;;;;;;;;;;;;;;;EAkBf,kBAAkB,SAAS,0BAA0B;;;;;;;;;;;;;;;;EAiBrD;;;;;;;;;;;;;;;;;EAkBA;;;;;;;;;;;;;EAcA;;UAGe;EACf,MAAM;EACN,iBAAiB;;UAGF;;;;;;;;;;EAUf;;;;;;;;;;;EAYA;;UCzEe;EACf,MAAM;EACN;EACA;;UAGe;;;;;EAKf;;;;;;;;;;;;;;;;;;EAkBA;;;;;EAMA,oBAAoB;;;;;;;EAQpB,wBAAwB;;;;;;EAOxB,2BAA2B;;;;;;;;;;;;;;;;;;;;;;EAuB3B;;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EA0BN,YAAY;;;;;;;;;EAUZ,mBAAmB;;KAGT,wBACR,wBACA,yBACA;KAEQ,wBAAwB,KAClC;EAGA,uBAAuB;;KAGb,yBAAyB,KACnC;;;;;EAOA,WAAW;;iBAKG,wBACd,QAAQ,KAAK,iCACZ;iBAOa,4BAA4B;iBAM5B,6BACd,OAAO,KAAK,kCACX;UCxMc;EACf;EACA;;UAGe;EACf,YAAY;EACZ,MAAM;EACN;EACA;EACA;;UAGe;;EAEf;EACA,YAAY;;KAGF,8BACV,gBAAgB,gBAChB,eAAe,YACf,iCACA,qCACG;KAEO,oBACV,QAAQ,cACR,wBAAwB,4BACrB,QAAQ;UAEI;;;;;;EAMf;;;;;;;;EASA,WAAW,aAAa;;;;;;EAOxB;;;;;;;;;;;;;;;;EAiBA,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDvB,qBAAqB;;;;;;;;;;;;;EAcrB;;UAGe;;;;;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