|
1 | | -import { ImageVisionAdapter, AdminUser, IAdminForth, StorageAdapter, ImageGenerationAdapter, CompletionAdapter } from "adminforth"; |
| 1 | +import { ImageVisionAdapter, ImageGenerationAdapter, CompletionAdapter } from "adminforth"; |
2 | 2 |
|
3 | 3 |
|
4 | 4 | export interface PluginOptions { |
| 5 | + /** |
| 6 | + * Name of the action in three dots menu. |
| 7 | + */ |
5 | 8 | actionName: string, |
| 9 | + |
| 10 | + /** |
| 11 | + * The adapter to use for scaning images and filling fields basing on the image content. |
| 12 | + */ |
6 | 13 | visionAdapter?: ImageVisionAdapter, |
| 14 | + |
| 15 | + /** |
| 16 | + * The adapter to use for text->text generation. |
| 17 | + */ |
7 | 18 | textCompleteAdapter?: CompletionAdapter, |
| 19 | + |
8 | 20 | /** |
9 | 21 | * The adapter to use for image generation. |
10 | 22 | */ |
11 | 23 | imageGenerationAdapter?: ImageGenerationAdapter, |
| 24 | + |
| 25 | + /** |
| 26 | + * List of fields that should be filled based on the image content analysis. |
| 27 | + */ |
12 | 28 | fillFieldsFromImages?: Record<string, string>, // can analyze what is on image and fill fields, typical tasks "find dominant color", "describe what is on image", "clasify to one enum item, e.g. what is on image dog/cat/plant" |
| 29 | + |
| 30 | + /** |
| 31 | + * List of fields that should be filled based on the text. |
| 32 | + */ |
13 | 33 | fillPlainFields?: Record<string, string>, |
| 34 | + |
| 35 | + /** |
| 36 | + * Number of tokens to generate (Only for text completion adapter). Default is 1000. 1 token ~= ¾ words |
| 37 | + */ |
| 38 | + fillPlainFieldsMaxTokens?: number, |
| 39 | + |
| 40 | + /** |
| 41 | + * If you want to generate fields or images based on the image content attached images |
| 42 | + */ |
14 | 43 | attachFiles?: ({ record }: { |
15 | 44 | record: any, |
16 | 45 | }) => string[] | Promise<string[]>, |
17 | 46 |
|
| 47 | + /** |
| 48 | + * List of image fields, that should be filled. |
| 49 | + */ |
18 | 50 | generateImages?: Record< |
19 | 51 | string, { |
20 | 52 | // can generate from images or just from another fields, e.g. "remove text from images", "improve image quality", "turn image into ghibli style" |
@@ -43,6 +75,10 @@ export interface PluginOptions { |
43 | 75 | */ |
44 | 76 | countToGenerate: number, |
45 | 77 | }>, |
| 78 | + |
| 79 | + /** |
| 80 | + * Rate limits for each action. |
| 81 | + */ |
46 | 82 | rateLimits?: { |
47 | 83 | fillFieldsFromImages?: string, // e.g. 5/1d - 5 requests per day |
48 | 84 | fillPlainFields?: string, |
|
0 commit comments