@fugood/bricks-project 2.21.0-beta.31 → 2.21.0-beta.32
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/compile/action-name-map.ts +63 -0
- package/package.json +2 -2
- package/types/bricks.ts +200 -0
- package/types/generators.ts +580 -10
- package/utils/data.ts +9 -0
|
@@ -561,11 +561,31 @@ export const templateActionNameMap = {
|
|
|
561
561
|
sessionCustomKey: 'GENERATOR_LLM_SESSION_CUSTOM_KEY',
|
|
562
562
|
},
|
|
563
563
|
},
|
|
564
|
+
GENERATOR_OPENAI_LLM: {
|
|
565
|
+
GENERATOR_OPENAI_LLM_COMPLETION: {
|
|
566
|
+
messages: 'GENERATOR_OPENAI_LLM_MESSAGES',
|
|
567
|
+
maxTokens: 'GENERATOR_OPENAI_LLM_MAX_TOKENS',
|
|
568
|
+
temperature: 'GENERATOR_OPENAI_LLM_TEMPERATURE',
|
|
569
|
+
topP: 'GENERATOR_OPENAI_LLM_TOP_P',
|
|
570
|
+
frequencyPenalty: 'GENERATOR_OPENAI_LLM_FREQUENCY_PENALTY',
|
|
571
|
+
presencePenalty: 'GENERATOR_OPENAI_LLM_PRESENCE_PENALTY',
|
|
572
|
+
stop: 'GENERATOR_OPENAI_LLM_STOP',
|
|
573
|
+
functionCallEnabled: 'GENERATOR_OPENAI_LLM_FUNCTION_CALL_ENABLED',
|
|
574
|
+
functionCallSchema: 'GENERATOR_OPENAI_LLM_FUNCTION_CALL_SCHEMA',
|
|
575
|
+
},
|
|
576
|
+
},
|
|
564
577
|
GENERATOR_ASSISTANT: {
|
|
565
578
|
GENERATOR_ASSISTANT_ADD_MESSAGE: {
|
|
566
579
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
567
580
|
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
568
581
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
582
|
+
useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
|
|
583
|
+
filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
|
|
584
|
+
fileName: 'GENERATOR_ASSISTANT_FILE_NAME',
|
|
585
|
+
fileExtension: 'GENERATOR_ASSISTANT_FILE_EXTENSION',
|
|
586
|
+
filePayload: 'GENERATOR_ASSISTANT_FILE_PAYLOAD',
|
|
587
|
+
fileSearchCitationCount: 'GENERATOR_ASSISTANT_FILE_SEARCH_CITATION_COUNT',
|
|
588
|
+
fileSearchInsertMethod: 'GENERATOR_ASSISTANT_FILE_SEARCH_INSERT_METHOD',
|
|
569
589
|
},
|
|
570
590
|
GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX: {
|
|
571
591
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
@@ -576,7 +596,23 @@ export const templateActionNameMap = {
|
|
|
576
596
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
577
597
|
contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
|
|
578
598
|
contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
|
|
599
|
+
useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
|
|
579
600
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
601
|
+
filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
|
|
602
|
+
fileName: 'GENERATOR_ASSISTANT_FILE_NAME',
|
|
603
|
+
fileExtension: 'GENERATOR_ASSISTANT_FILE_EXTENSION',
|
|
604
|
+
filePayload: 'GENERATOR_ASSISTANT_FILE_PAYLOAD',
|
|
605
|
+
fileSearchCitationCount: 'GENERATOR_ASSISTANT_FILE_SEARCH_CITATION_COUNT',
|
|
606
|
+
fileSearchInsertMethod: 'GENERATOR_ASSISTANT_FILE_SEARCH_INSERT_METHOD',
|
|
607
|
+
},
|
|
608
|
+
GENERATOR_ASSISTANT_ADD_FILE: {
|
|
609
|
+
filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
|
|
610
|
+
fileName: 'GENERATOR_ASSISTANT_FILE_NAME',
|
|
611
|
+
fileExtension: 'GENERATOR_ASSISTANT_FILE_EXTENSION',
|
|
612
|
+
filePayload: 'GENERATOR_ASSISTANT_FILE_PAYLOAD',
|
|
613
|
+
},
|
|
614
|
+
GENERATOR_ASSISTANT_REMOVE_FILE: {
|
|
615
|
+
fileName: 'GENERATOR_ASSISTANT_FILE_NAME',
|
|
580
616
|
},
|
|
581
617
|
GENERATOR_ASSISTANT_UPDATE_AUDIO_MESSAGE_AT_INDEX: {
|
|
582
618
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
@@ -588,4 +624,31 @@ export const templateActionNameMap = {
|
|
|
588
624
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
589
625
|
},
|
|
590
626
|
},
|
|
627
|
+
GENERATOR_VECTOR_STORE: {
|
|
628
|
+
GENERATOR_VECTOR_STORE_RESET: {
|
|
629
|
+
resetType: 'GENERATOR_VECTOR_STORE_RESET_TYPE',
|
|
630
|
+
},
|
|
631
|
+
GENERATOR_VECTOR_STORE_INSERT_FILE: {
|
|
632
|
+
filePath: 'GENERATOR_VECTOR_STORE_FILE_PATH',
|
|
633
|
+
fileName: 'GENERATOR_VECTOR_STORE_FILE_NAME',
|
|
634
|
+
fileExtension: 'GENERATOR_VECTOR_STORE_FILE_EXTENSION',
|
|
635
|
+
chunkSize: 'GENERATOR_VECTOR_STORE_CHUNK_SIZE',
|
|
636
|
+
},
|
|
637
|
+
GENERATOR_VECTOR_STORE_INSERT_CONTENT: {
|
|
638
|
+
textContent: 'GENERATOR_VECTOR_STORE_TEXT_CONTENT',
|
|
639
|
+
fileName: 'GENERATOR_VECTOR_STORE_FILE_NAME',
|
|
640
|
+
payload: 'GENERATOR_VECTOR_STORE_PAYLOAD',
|
|
641
|
+
chunkSize: 'GENERATOR_VECTOR_STORE_CHUNK_SIZE',
|
|
642
|
+
},
|
|
643
|
+
GENERATOR_VECTOR_STORE_REMOVE_FILE: {
|
|
644
|
+
fileName: 'GENERATOR_VECTOR_STORE_FILE_NAME',
|
|
645
|
+
},
|
|
646
|
+
GENERATOR_VECTOR_STORE_SEARCH: {
|
|
647
|
+
text: 'GENERATOR_VECTOR_STORE_TEXT',
|
|
648
|
+
filename: 'GENERATOR_VECTOR_STORE_FILENAME',
|
|
649
|
+
limit: 'GENERATOR_VECTOR_STORE_LIMIT',
|
|
650
|
+
threshold: 'GENERATOR_VECTOR_STORE_THRESHOLD',
|
|
651
|
+
ignoreThreshold: 'GENERATOR_VECTOR_STORE_IGNORE_THRESHOLD',
|
|
652
|
+
},
|
|
653
|
+
},
|
|
591
654
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.21.0-beta.
|
|
3
|
+
"version": "2.21.0-beta.32",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node scripts/build.js"
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
"lodash": "^4.17.4",
|
|
14
14
|
"uuid": "^8.3.1"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "47ddd77695dc02c25ec8d79617f55fc2194e16d3"
|
|
17
17
|
}
|
package/types/bricks.ts
CHANGED
|
@@ -3489,3 +3489,203 @@ export type Brick3DViewer = Brick &
|
|
|
3489
3489
|
}
|
|
3490
3490
|
>
|
|
3491
3491
|
}
|
|
3492
|
+
|
|
3493
|
+
interface GenerativeMediaDef {
|
|
3494
|
+
/*
|
|
3495
|
+
Default property:
|
|
3496
|
+
{
|
|
3497
|
+
"enableCache": true,
|
|
3498
|
+
"type": "image",
|
|
3499
|
+
"resizeMode": "cover",
|
|
3500
|
+
"provider": "openai"
|
|
3501
|
+
}
|
|
3502
|
+
*/
|
|
3503
|
+
property?: BrickBasicProperty & {
|
|
3504
|
+
/* The text prompt to generate media from */
|
|
3505
|
+
prompt?: string | DataLink
|
|
3506
|
+
/* Enable cache */
|
|
3507
|
+
enableCache?: boolean | DataLink
|
|
3508
|
+
/* The type of media to generate (image or video) */
|
|
3509
|
+
type?: 'image' | 'video' | DataLink
|
|
3510
|
+
/* The Lottie animation to show while generating */
|
|
3511
|
+
loadingAnimation?: string | DataLink
|
|
3512
|
+
/* The Lottie animation to show when an error occurs */
|
|
3513
|
+
errorAnimation?: string | DataLink
|
|
3514
|
+
/* The resize mode for the generated media */
|
|
3515
|
+
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' | DataLink
|
|
3516
|
+
/* The API key for the generative media service */
|
|
3517
|
+
apiKey?: string | DataLink
|
|
3518
|
+
/* The AI provider to use for generation (openai, freepik, or deepai) */
|
|
3519
|
+
provider?: 'openai' | 'freepik-classic' | 'deepai' | DataLink
|
|
3520
|
+
/* OpenAI image size (256x256, 512x512, 1024x1024, etc) */
|
|
3521
|
+
openaiSize?: '1024x1024' | '1024x1792' | '1792x1024' | DataLink
|
|
3522
|
+
/* OpenAI image style (vivid or natural) */
|
|
3523
|
+
openaiStyle?: 'vivid' | 'natural' | DataLink
|
|
3524
|
+
/* OpenAI image quality (standard or hd) */
|
|
3525
|
+
openaiQuality?: 'standard' | 'hd' | DataLink
|
|
3526
|
+
/* Freepik image style */
|
|
3527
|
+
freepikClassicStyle?: string | DataLink
|
|
3528
|
+
/* Freepik image size */
|
|
3529
|
+
freepikClassicSize?: 'square' | 'portrait' | 'landscape' | DataLink
|
|
3530
|
+
/* Freepik color scheme */
|
|
3531
|
+
freepikClassicColor?: string | DataLink
|
|
3532
|
+
/* Freepik lighting style */
|
|
3533
|
+
freepikClassicLighting?: string | DataLink
|
|
3534
|
+
/* Freepik framing style */
|
|
3535
|
+
freepikClassicFraming?: string | DataLink
|
|
3536
|
+
/* Freepik guidance scale (level of fidelity to prompt) */
|
|
3537
|
+
freepikClassicGuidanceScale?: number | DataLink
|
|
3538
|
+
/* Freepik negative prompt (attributes to avoid) */
|
|
3539
|
+
freepikClassicNegativePrompt?: string | DataLink
|
|
3540
|
+
/* DeepAI negative prompt (attributes to avoid) */
|
|
3541
|
+
deepaiNegativePrompt?: string | DataLink
|
|
3542
|
+
/* DeepAI image generator version */
|
|
3543
|
+
deepaiImageGeneratorVersion?: 'standard' | 'hd' | DataLink
|
|
3544
|
+
/* DeepAI output image width */
|
|
3545
|
+
deepaiWidth?: number | DataLink
|
|
3546
|
+
/* DeepAI output image height */
|
|
3547
|
+
deepaiHeight?: number | DataLink
|
|
3548
|
+
}
|
|
3549
|
+
events?: BrickBasicEvents & {
|
|
3550
|
+
/* Event of the brick press */
|
|
3551
|
+
generativeMediaOnPress?: Array<EventAction>
|
|
3552
|
+
/* Event of the brick press in */
|
|
3553
|
+
generativeMediaOnPressIn?: Array<EventAction>
|
|
3554
|
+
/* Event of the brick press out */
|
|
3555
|
+
generativeMediaOnPressOut?: Array<EventAction>
|
|
3556
|
+
/* Event of the brick focus (Use TV Device with controller) */
|
|
3557
|
+
generativeMediaOnFocus?: Array<EventAction>
|
|
3558
|
+
/* Event of the brick blur (Use TV Device with controller) */
|
|
3559
|
+
generativeMediaOnBlur?: Array<EventAction>
|
|
3560
|
+
/* Event when media generation succeeds */
|
|
3561
|
+
onSuccess?: Array<
|
|
3562
|
+
EventAction & {
|
|
3563
|
+
eventPropertyMapping?: {
|
|
3564
|
+
url: {
|
|
3565
|
+
type: 'string'
|
|
3566
|
+
path: string
|
|
3567
|
+
}
|
|
3568
|
+
}
|
|
3569
|
+
}
|
|
3570
|
+
>
|
|
3571
|
+
/* Event when media generation fails */
|
|
3572
|
+
onError?: Array<
|
|
3573
|
+
EventAction & {
|
|
3574
|
+
eventPropertyMapping?: {
|
|
3575
|
+
error: {
|
|
3576
|
+
type: 'string'
|
|
3577
|
+
path: string
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
>
|
|
3582
|
+
/* Event when media prompt request starts */
|
|
3583
|
+
promptStart?: Array<
|
|
3584
|
+
EventAction & {
|
|
3585
|
+
eventPropertyMapping?: {
|
|
3586
|
+
prompt: {
|
|
3587
|
+
type: 'string'
|
|
3588
|
+
path: string
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3592
|
+
>
|
|
3593
|
+
/* Event when media prompt request succeeds */
|
|
3594
|
+
promptSuccess?: Array<
|
|
3595
|
+
EventAction & {
|
|
3596
|
+
eventPropertyMapping?: {
|
|
3597
|
+
url: {
|
|
3598
|
+
type: 'string'
|
|
3599
|
+
path: string
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3603
|
+
>
|
|
3604
|
+
/* Event when media prompt request fails */
|
|
3605
|
+
promptError?: Array<
|
|
3606
|
+
EventAction & {
|
|
3607
|
+
eventPropertyMapping?: {
|
|
3608
|
+
error: {
|
|
3609
|
+
type: 'string'
|
|
3610
|
+
path: string
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
>
|
|
3615
|
+
/* Event when media loading starts */
|
|
3616
|
+
loadStart?: Array<
|
|
3617
|
+
EventAction & {
|
|
3618
|
+
eventPropertyMapping?: {}
|
|
3619
|
+
}
|
|
3620
|
+
>
|
|
3621
|
+
/* Event when media loading succeeds */
|
|
3622
|
+
loadSuccess?: Array<
|
|
3623
|
+
EventAction & {
|
|
3624
|
+
eventPropertyMapping?: {
|
|
3625
|
+
url: {
|
|
3626
|
+
type: 'string'
|
|
3627
|
+
path: string
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
>
|
|
3632
|
+
/* Event when media loading fails */
|
|
3633
|
+
loadError?: Array<
|
|
3634
|
+
EventAction & {
|
|
3635
|
+
eventPropertyMapping?: {
|
|
3636
|
+
error: {
|
|
3637
|
+
type: 'string'
|
|
3638
|
+
path: string
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
>
|
|
3643
|
+
}
|
|
3644
|
+
outlets?: {
|
|
3645
|
+
/* Brick is pressing */
|
|
3646
|
+
brickPressing?: () => Data
|
|
3647
|
+
/* Brick is focusing (Use TV Device with controller) */
|
|
3648
|
+
brickFocusing?: () => Data
|
|
3649
|
+
/* Generated media URL */
|
|
3650
|
+
url?: () => Data
|
|
3651
|
+
/* Generated media error */
|
|
3652
|
+
error?: () => Data
|
|
3653
|
+
}
|
|
3654
|
+
animation?: AnimationBasicEvents & {
|
|
3655
|
+
generativeMediaOnPress?: Animation
|
|
3656
|
+
generativeMediaOnPressIn?: Animation
|
|
3657
|
+
generativeMediaOnPressOut?: Animation
|
|
3658
|
+
generativeMediaOnFocus?: Animation
|
|
3659
|
+
generativeMediaOnBlur?: Animation
|
|
3660
|
+
onSuccess?: Animation
|
|
3661
|
+
onError?: Animation
|
|
3662
|
+
promptStart?: Animation
|
|
3663
|
+
promptSuccess?: Animation
|
|
3664
|
+
promptError?: Animation
|
|
3665
|
+
loadStart?: Animation
|
|
3666
|
+
loadSuccess?: Animation
|
|
3667
|
+
loadError?: Animation
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3671
|
+
/* Generative Media brick - Generate images and videos using AI */
|
|
3672
|
+
export type GenerativeMedia = Brick &
|
|
3673
|
+
GenerativeMediaDef & {
|
|
3674
|
+
templateKey: 'BRICK_GENERATIVE_MEDIA'
|
|
3675
|
+
switches: Array<
|
|
3676
|
+
SwitchDef &
|
|
3677
|
+
GenerativeMediaDef & {
|
|
3678
|
+
conds?: Array<{
|
|
3679
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
3680
|
+
cond:
|
|
3681
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
3682
|
+
| SwitchCondData
|
|
3683
|
+
| {
|
|
3684
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
3685
|
+
outlet: 'brickPressing' | 'brickFocusing' | 'url' | 'error'
|
|
3686
|
+
value: any
|
|
3687
|
+
}
|
|
3688
|
+
}>
|
|
3689
|
+
}
|
|
3690
|
+
>
|
|
3691
|
+
}
|
package/types/generators.ts
CHANGED
|
@@ -892,6 +892,8 @@ Default property:
|
|
|
892
892
|
downloadProgress?: () => Data
|
|
893
893
|
/* File sync download errors */
|
|
894
894
|
downloadErrors?: () => Data
|
|
895
|
+
/* Media box info */
|
|
896
|
+
box?: () => Data
|
|
895
897
|
/* File sync result [ { "url": "/storage/emulated/0/Download/SyncFolder/Asset/1.png", "mediaType": "photo" // enum("photo", "video"), used to distingiush "id": "", } ] */
|
|
896
898
|
downloadFileUrls?: () => Data
|
|
897
899
|
/* Save Media Flow fetch result [ { "url": "https://d1kk0369g9vrck.cloudfront.net/box/5b431e29efd40c01e8b2019c/photo5b431e37efd40c01e8b201d1" "extension": "", // enum("jpg", "png", "mp4") "id": "5b431e37efd40c01e8b201d1", "md5": "6134ab412351651324" // md5 came from media resource api } ] */
|
|
@@ -917,6 +919,7 @@ export type GeneratorMediaFlow = Generator &
|
|
|
917
919
|
| 'downloadStatus'
|
|
918
920
|
| 'downloadProgress'
|
|
919
921
|
| 'downloadErrors'
|
|
922
|
+
| 'box'
|
|
920
923
|
| 'downloadFileUrls'
|
|
921
924
|
| 'result'
|
|
922
925
|
value: any
|
|
@@ -1497,9 +1500,7 @@ Please note that the key code is not supported on iOS / tvOS, so it will use `ke
|
|
|
1497
1500
|
}
|
|
1498
1501
|
}
|
|
1499
1502
|
|
|
1500
|
-
/* Listening keyboard (controller) event
|
|
1501
|
-
|
|
1502
|
-
NOTE: For iOS, if you're using iOS version less than 13.4, it only supports keyboard up event. */
|
|
1503
|
+
/* Listening keyboard (controller) event */
|
|
1503
1504
|
export type GeneratorKeyboard = Generator &
|
|
1504
1505
|
GeneratorKeyboardDef & {
|
|
1505
1506
|
templateKey: 'GENERATOR_KEYBOARD'
|
|
@@ -4544,9 +4545,7 @@ Default property:
|
|
|
4544
4545
|
}
|
|
4545
4546
|
}
|
|
4546
4547
|
|
|
4547
|
-
/* [UNSTABLE] Tap to Pay on iPhone (iOS only)
|
|
4548
|
-
|
|
4549
|
-
\* Currently it is not included in the Production build. */
|
|
4548
|
+
/* [UNSTABLE] Tap to Pay on iPhone (iOS only) */
|
|
4550
4549
|
export type GeneratorTapPayT2P = Generator &
|
|
4551
4550
|
GeneratorTapPayT2PDef & {
|
|
4552
4551
|
templateKey: 'GENERATOR_TAPPAY_T2P_IOS'
|
|
@@ -4709,7 +4708,7 @@ Default property:
|
|
|
4709
4708
|
/* Connect printer on generator initialized */
|
|
4710
4709
|
init?: boolean | DataLink
|
|
4711
4710
|
/* Connection driver */
|
|
4712
|
-
driver?: 'escpos' | 'star' | DataLink
|
|
4711
|
+
driver?: 'escpos' | 'star' | 'tsc' | DataLink
|
|
4713
4712
|
/* The address of the printer */
|
|
4714
4713
|
connectString?: string | DataLink
|
|
4715
4714
|
/* The language of the printer (only for EPSON) */
|
|
@@ -4738,7 +4737,8 @@ Default property:
|
|
|
4738
4737
|
Notes:
|
|
4739
4738
|
- `reverse-feed` only works on ESC/POS driver
|
|
4740
4739
|
- `width` and `height` in Star driver is magnification factor
|
|
4741
|
-
- `y` position in ESC/POS is use feed lines to offset
|
|
4740
|
+
- `y` position in ESC/POS is use feed lines to offset
|
|
4741
|
+
- `textFont` only works on TSC driver */
|
|
4742
4742
|
payload?:
|
|
4743
4743
|
| Array<
|
|
4744
4744
|
| DataLink
|
|
@@ -4762,6 +4762,7 @@ Default property:
|
|
|
4762
4762
|
textEmphasize?: boolean | DataLink
|
|
4763
4763
|
textUnderline?: boolean | DataLink
|
|
4764
4764
|
textLang?: 'EN' | 'JA' | 'ZH_CN' | 'ZH_TW' | 'KO' | 'TH' | 'VI' | 'MULTI' | DataLink
|
|
4765
|
+
textFont?: string | DataLink
|
|
4765
4766
|
barcodeType?:
|
|
4766
4767
|
| 'CODE39'
|
|
4767
4768
|
| 'CODE93'
|
|
@@ -4778,6 +4779,7 @@ Default property:
|
|
|
4778
4779
|
qrcodeModel?: '1' | '2' | DataLink
|
|
4779
4780
|
qrcodeSize?: number | DataLink
|
|
4780
4781
|
qrcodeLevel?: 'L' | 'M' | 'Q' | 'H' | DataLink
|
|
4782
|
+
qrcodeMask?: 'S0' | 'S1' | 'S2' | 'S3' | 'S4' | 'S5' | 'S6' | 'S7' | DataLink
|
|
4781
4783
|
feedLines?: number | DataLink
|
|
4782
4784
|
lineSpace?: number | DataLink
|
|
4783
4785
|
}
|
|
@@ -6187,6 +6189,7 @@ Default property:
|
|
|
6187
6189
|
"init": false,
|
|
6188
6190
|
"contextSize": 512,
|
|
6189
6191
|
"batchSize": 512,
|
|
6192
|
+
"uBatchSize": 512,
|
|
6190
6193
|
"accelVariant": "default",
|
|
6191
6194
|
"mainGpu": 0,
|
|
6192
6195
|
"gpuLayers": 0,
|
|
@@ -6252,8 +6255,10 @@ Default property:
|
|
|
6252
6255
|
modelHash?: string | DataLink
|
|
6253
6256
|
/* Context size (0 ~ 4096) (Default to 512) */
|
|
6254
6257
|
contextSize?: number | DataLink
|
|
6255
|
-
/*
|
|
6258
|
+
/* Logical batch size for prompt processing */
|
|
6256
6259
|
batchSize?: number | DataLink
|
|
6260
|
+
/* Physical batch size for prompt processing */
|
|
6261
|
+
uBatchSize?: number | DataLink
|
|
6257
6262
|
/* Number of threads */
|
|
6258
6263
|
maxThreads?: number | DataLink
|
|
6259
6264
|
/* Accelerator variant (Only for desktop)
|
|
@@ -6530,6 +6535,211 @@ export type GeneratorLLM = Generator &
|
|
|
6530
6535
|
>
|
|
6531
6536
|
}
|
|
6532
6537
|
|
|
6538
|
+
/* Run text completion */
|
|
6539
|
+
export type GeneratorOpenAILLMActionCompletion = ActionWithParams & {
|
|
6540
|
+
__actionName: 'GENERATOR_OPENAI_LLM_COMPLETION'
|
|
6541
|
+
params?: Array<
|
|
6542
|
+
| {
|
|
6543
|
+
input: 'messages'
|
|
6544
|
+
value?: Array<any> | DataLink
|
|
6545
|
+
mapping?: string
|
|
6546
|
+
}
|
|
6547
|
+
| {
|
|
6548
|
+
input: 'maxTokens'
|
|
6549
|
+
value?: number | DataLink
|
|
6550
|
+
mapping?: string
|
|
6551
|
+
}
|
|
6552
|
+
| {
|
|
6553
|
+
input: 'temperature'
|
|
6554
|
+
value?: number | DataLink
|
|
6555
|
+
mapping?: string
|
|
6556
|
+
}
|
|
6557
|
+
| {
|
|
6558
|
+
input: 'topP'
|
|
6559
|
+
value?: number | DataLink
|
|
6560
|
+
mapping?: string
|
|
6561
|
+
}
|
|
6562
|
+
| {
|
|
6563
|
+
input: 'frequencyPenalty'
|
|
6564
|
+
value?: number | DataLink
|
|
6565
|
+
mapping?: string
|
|
6566
|
+
}
|
|
6567
|
+
| {
|
|
6568
|
+
input: 'presencePenalty'
|
|
6569
|
+
value?: number | DataLink
|
|
6570
|
+
mapping?: string
|
|
6571
|
+
}
|
|
6572
|
+
| {
|
|
6573
|
+
input: 'stop'
|
|
6574
|
+
value?: Array<any> | DataLink
|
|
6575
|
+
mapping?: string
|
|
6576
|
+
}
|
|
6577
|
+
| {
|
|
6578
|
+
input: 'functionCallEnabled'
|
|
6579
|
+
value?: boolean | DataLink
|
|
6580
|
+
mapping?: string
|
|
6581
|
+
}
|
|
6582
|
+
| {
|
|
6583
|
+
input: 'functionCallSchema'
|
|
6584
|
+
value?: Array<any> | DataLink
|
|
6585
|
+
mapping?: string
|
|
6586
|
+
}
|
|
6587
|
+
>
|
|
6588
|
+
}
|
|
6589
|
+
|
|
6590
|
+
/* Stop text completion */
|
|
6591
|
+
export type GeneratorOpenAILLMActionStopCompletion = Action & {
|
|
6592
|
+
__actionName: 'GENERATOR_OPENAI_LLM_STOP_COMPLETION'
|
|
6593
|
+
}
|
|
6594
|
+
|
|
6595
|
+
interface GeneratorOpenAILLMDef {
|
|
6596
|
+
/*
|
|
6597
|
+
Default property:
|
|
6598
|
+
{
|
|
6599
|
+
"apiEndpoint": "https://api.openai.com/v1",
|
|
6600
|
+
"model": "gpt-4o-mini",
|
|
6601
|
+
"completionMessages": [
|
|
6602
|
+
null
|
|
6603
|
+
],
|
|
6604
|
+
"completionMaxTokens": 1024,
|
|
6605
|
+
"completionTemperature": 1,
|
|
6606
|
+
"completionTopP": 1,
|
|
6607
|
+
"completionFrequencyPenalty": 0,
|
|
6608
|
+
"completionPresencePenalty": 0,
|
|
6609
|
+
"completionStop": []
|
|
6610
|
+
}
|
|
6611
|
+
*/
|
|
6612
|
+
property?: {
|
|
6613
|
+
/* API endpoint URL */
|
|
6614
|
+
apiEndpoint?: string | DataLink
|
|
6615
|
+
/* API key */
|
|
6616
|
+
apiKey?: string | DataLink
|
|
6617
|
+
/* Model name (Default: gpt-4o-mini) */
|
|
6618
|
+
model?: string | DataLink
|
|
6619
|
+
/* Chat messages */
|
|
6620
|
+
completionMessages?:
|
|
6621
|
+
| Array<
|
|
6622
|
+
| DataLink
|
|
6623
|
+
| {
|
|
6624
|
+
role?: string | DataLink
|
|
6625
|
+
content?:
|
|
6626
|
+
| string
|
|
6627
|
+
| DataLink
|
|
6628
|
+
| DataLink
|
|
6629
|
+
| {
|
|
6630
|
+
type?: string | DataLink
|
|
6631
|
+
text?: string | DataLink
|
|
6632
|
+
image_url?: string | DataLink
|
|
6633
|
+
}
|
|
6634
|
+
| DataLink
|
|
6635
|
+
}
|
|
6636
|
+
>
|
|
6637
|
+
| DataLink
|
|
6638
|
+
/* Maximum tokens to generate */
|
|
6639
|
+
completionMaxTokens?: number | DataLink
|
|
6640
|
+
/* Temperature */
|
|
6641
|
+
completionTemperature?: number | DataLink
|
|
6642
|
+
/* Top P sampling */
|
|
6643
|
+
completionTopP?: number | DataLink
|
|
6644
|
+
/* Frequency penalty */
|
|
6645
|
+
completionFrequencyPenalty?: number | DataLink
|
|
6646
|
+
/* Presence penalty */
|
|
6647
|
+
completionPresencePenalty?: number | DataLink
|
|
6648
|
+
/* Stop sequences */
|
|
6649
|
+
completionStop?: Array<string | DataLink> | DataLink
|
|
6650
|
+
/* Enable function calling. */
|
|
6651
|
+
functionCallEnabled?: boolean | DataLink
|
|
6652
|
+
/* The function calling schema (ref: https://platform.openai.com/docs/guides/gpt/function-calling) */
|
|
6653
|
+
functionCallSchema?: Array<DataLink | {}> | DataLink
|
|
6654
|
+
}
|
|
6655
|
+
events?: {
|
|
6656
|
+
/* Error event */
|
|
6657
|
+
onError?: Array<
|
|
6658
|
+
EventAction & {
|
|
6659
|
+
eventPropertyMapping?: {
|
|
6660
|
+
error: {
|
|
6661
|
+
type: 'string'
|
|
6662
|
+
path: string
|
|
6663
|
+
}
|
|
6664
|
+
}
|
|
6665
|
+
}
|
|
6666
|
+
>
|
|
6667
|
+
/* Completion event */
|
|
6668
|
+
onCompletion?: Array<
|
|
6669
|
+
EventAction & {
|
|
6670
|
+
eventPropertyMapping?: {
|
|
6671
|
+
completionResult: {
|
|
6672
|
+
type: 'string'
|
|
6673
|
+
path: string
|
|
6674
|
+
}
|
|
6675
|
+
}
|
|
6676
|
+
}
|
|
6677
|
+
>
|
|
6678
|
+
/* Completion finished event */
|
|
6679
|
+
onCompletionFinished?: Array<
|
|
6680
|
+
EventAction & {
|
|
6681
|
+
eventPropertyMapping?: {
|
|
6682
|
+
completionResult: {
|
|
6683
|
+
type: 'string'
|
|
6684
|
+
path: string
|
|
6685
|
+
}
|
|
6686
|
+
}
|
|
6687
|
+
}
|
|
6688
|
+
>
|
|
6689
|
+
/* Completion function call event */
|
|
6690
|
+
onCompletionFunctionCall?: Array<
|
|
6691
|
+
EventAction & {
|
|
6692
|
+
eventPropertyMapping?: {
|
|
6693
|
+
completionFunctionCallName: {
|
|
6694
|
+
type: 'string'
|
|
6695
|
+
path: string
|
|
6696
|
+
}
|
|
6697
|
+
completionFunctionArguments: {
|
|
6698
|
+
type: 'string'
|
|
6699
|
+
path: string
|
|
6700
|
+
}
|
|
6701
|
+
}
|
|
6702
|
+
}
|
|
6703
|
+
>
|
|
6704
|
+
}
|
|
6705
|
+
outlets?: {
|
|
6706
|
+
/* Evaluating outlet */
|
|
6707
|
+
isEvaluating?: () => Data
|
|
6708
|
+
/* Completion result outlet */
|
|
6709
|
+
completionResult?: () => Data
|
|
6710
|
+
/* Completion details outlet */
|
|
6711
|
+
completionDetails?: () => Data
|
|
6712
|
+
}
|
|
6713
|
+
}
|
|
6714
|
+
|
|
6715
|
+
/* LLM inference using OpenAI-compatible API endpoints
|
|
6716
|
+
|
|
6717
|
+
## Features
|
|
6718
|
+
- Compatible with OpenAI API format
|
|
6719
|
+
- Supports function calling
|
|
6720
|
+
- Streaming responses
|
|
6721
|
+
- Custom API endpoints */
|
|
6722
|
+
export type GeneratorOpenAILLM = Generator &
|
|
6723
|
+
GeneratorOpenAILLMDef & {
|
|
6724
|
+
templateKey: 'GENERATOR_OPENAI_LLM'
|
|
6725
|
+
switches: Array<
|
|
6726
|
+
SwitchDef &
|
|
6727
|
+
GeneratorOpenAILLMDef & {
|
|
6728
|
+
conds?: Array<{
|
|
6729
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
6730
|
+
cond:
|
|
6731
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
6732
|
+
| SwitchCondData
|
|
6733
|
+
| {
|
|
6734
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
6735
|
+
outlet: 'isEvaluating' | 'completionResult' | 'completionDetails'
|
|
6736
|
+
value: any
|
|
6737
|
+
}
|
|
6738
|
+
}>
|
|
6739
|
+
}
|
|
6740
|
+
>
|
|
6741
|
+
}
|
|
6742
|
+
|
|
6533
6743
|
/* Add a message to the assistant */
|
|
6534
6744
|
export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
6535
6745
|
__actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
|
|
@@ -6549,6 +6759,41 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
|
6549
6759
|
value?: {} | DataLink
|
|
6550
6760
|
mapping?: string
|
|
6551
6761
|
}
|
|
6762
|
+
| {
|
|
6763
|
+
input: 'useFileSearch'
|
|
6764
|
+
value?: boolean | DataLink
|
|
6765
|
+
mapping?: string
|
|
6766
|
+
}
|
|
6767
|
+
| {
|
|
6768
|
+
input: 'filePath'
|
|
6769
|
+
value?: string | DataLink
|
|
6770
|
+
mapping?: string
|
|
6771
|
+
}
|
|
6772
|
+
| {
|
|
6773
|
+
input: 'fileName'
|
|
6774
|
+
value?: string | DataLink
|
|
6775
|
+
mapping?: string
|
|
6776
|
+
}
|
|
6777
|
+
| {
|
|
6778
|
+
input: 'fileExtension'
|
|
6779
|
+
value?: string | DataLink
|
|
6780
|
+
mapping?: string
|
|
6781
|
+
}
|
|
6782
|
+
| {
|
|
6783
|
+
input: 'filePayload'
|
|
6784
|
+
value?: {} | DataLink
|
|
6785
|
+
mapping?: string
|
|
6786
|
+
}
|
|
6787
|
+
| {
|
|
6788
|
+
input: 'fileSearchCitationCount'
|
|
6789
|
+
value?: number | DataLink
|
|
6790
|
+
mapping?: string
|
|
6791
|
+
}
|
|
6792
|
+
| {
|
|
6793
|
+
input: 'fileSearchInsertMethod'
|
|
6794
|
+
value?: 'in-user-message' | 'new-assistant-message' | DataLink
|
|
6795
|
+
mapping?: string
|
|
6796
|
+
}
|
|
6552
6797
|
>
|
|
6553
6798
|
}
|
|
6554
6799
|
|
|
@@ -6593,14 +6838,86 @@ export type GeneratorAssistantActionAddAudioMessage = ActionWithParams & {
|
|
|
6593
6838
|
value?: string | DataLink
|
|
6594
6839
|
mapping?: string
|
|
6595
6840
|
}
|
|
6841
|
+
| {
|
|
6842
|
+
input: 'useFileSearch'
|
|
6843
|
+
value?: boolean | DataLink
|
|
6844
|
+
mapping?: string
|
|
6845
|
+
}
|
|
6596
6846
|
| {
|
|
6597
6847
|
input: 'payload'
|
|
6598
6848
|
value?: {} | DataLink
|
|
6599
6849
|
mapping?: string
|
|
6600
6850
|
}
|
|
6851
|
+
| {
|
|
6852
|
+
input: 'filePath'
|
|
6853
|
+
value?: string | DataLink
|
|
6854
|
+
mapping?: string
|
|
6855
|
+
}
|
|
6856
|
+
| {
|
|
6857
|
+
input: 'fileName'
|
|
6858
|
+
value?: string | DataLink
|
|
6859
|
+
mapping?: string
|
|
6860
|
+
}
|
|
6861
|
+
| {
|
|
6862
|
+
input: 'fileExtension'
|
|
6863
|
+
value?: string | DataLink
|
|
6864
|
+
mapping?: string
|
|
6865
|
+
}
|
|
6866
|
+
| {
|
|
6867
|
+
input: 'filePayload'
|
|
6868
|
+
value?: {} | DataLink
|
|
6869
|
+
mapping?: string
|
|
6870
|
+
}
|
|
6871
|
+
| {
|
|
6872
|
+
input: 'fileSearchCitationCount'
|
|
6873
|
+
value?: number | DataLink
|
|
6874
|
+
mapping?: string
|
|
6875
|
+
}
|
|
6876
|
+
| {
|
|
6877
|
+
input: 'fileSearchInsertMethod'
|
|
6878
|
+
value?: 'in-user-message' | 'new-assistant-message' | DataLink
|
|
6879
|
+
mapping?: string
|
|
6880
|
+
}
|
|
6601
6881
|
>
|
|
6602
6882
|
}
|
|
6603
6883
|
|
|
6884
|
+
/* Add a file to File Search (Vector Store) */
|
|
6885
|
+
export type GeneratorAssistantActionAddFile = ActionWithParams & {
|
|
6886
|
+
__actionName: 'GENERATOR_ASSISTANT_ADD_FILE'
|
|
6887
|
+
params?: Array<
|
|
6888
|
+
| {
|
|
6889
|
+
input: 'filePath'
|
|
6890
|
+
value?: string | DataLink
|
|
6891
|
+
mapping?: string
|
|
6892
|
+
}
|
|
6893
|
+
| {
|
|
6894
|
+
input: 'fileName'
|
|
6895
|
+
value?: string | DataLink
|
|
6896
|
+
mapping?: string
|
|
6897
|
+
}
|
|
6898
|
+
| {
|
|
6899
|
+
input: 'fileExtension'
|
|
6900
|
+
value?: string | DataLink
|
|
6901
|
+
mapping?: string
|
|
6902
|
+
}
|
|
6903
|
+
| {
|
|
6904
|
+
input: 'filePayload'
|
|
6905
|
+
value?: {} | DataLink
|
|
6906
|
+
mapping?: string
|
|
6907
|
+
}
|
|
6908
|
+
>
|
|
6909
|
+
}
|
|
6910
|
+
|
|
6911
|
+
/* Remove a file from File Search (Vector Store) */
|
|
6912
|
+
export type GeneratorAssistantActionRemoveFile = ActionWithParams & {
|
|
6913
|
+
__actionName: 'GENERATOR_ASSISTANT_REMOVE_FILE'
|
|
6914
|
+
params?: Array<{
|
|
6915
|
+
input: 'fileName'
|
|
6916
|
+
value?: string | DataLink
|
|
6917
|
+
mapping?: string
|
|
6918
|
+
}>
|
|
6919
|
+
}
|
|
6920
|
+
|
|
6604
6921
|
/* Update a audio message at a specific index */
|
|
6605
6922
|
export type GeneratorAssistantActionUpdateAudioMessageAtIndex = ActionWithParams & {
|
|
6606
6923
|
__actionName: 'GENERATOR_ASSISTANT_UPDATE_AUDIO_MESSAGE_AT_INDEX'
|
|
@@ -6643,6 +6960,11 @@ export type GeneratorAssistantActionResetMessages = Action & {
|
|
|
6643
6960
|
__actionName: 'GENERATOR_ASSISTANT_RESET_MESSAGES'
|
|
6644
6961
|
}
|
|
6645
6962
|
|
|
6963
|
+
/* Reset assistant (Reset all messages and files) */
|
|
6964
|
+
export type GeneratorAssistantActionReset = Action & {
|
|
6965
|
+
__actionName: 'GENERATOR_ASSISTANT_RESET'
|
|
6966
|
+
}
|
|
6967
|
+
|
|
6646
6968
|
/* Submit the assistant */
|
|
6647
6969
|
export type GeneratorAssistantActionSubmit = Action & {
|
|
6648
6970
|
__actionName: 'GENERATOR_ASSISTANT_SUBMIT'
|
|
@@ -6663,6 +6985,8 @@ Default property:
|
|
|
6663
6985
|
"cacheMessages": false,
|
|
6664
6986
|
"llmLivePolicy": "only-in-use",
|
|
6665
6987
|
"llmSessionKey": "default-assistant",
|
|
6988
|
+
"fileSearchEnabled": false,
|
|
6989
|
+
"fileSearchLivePolicy": "only-in-use",
|
|
6666
6990
|
"sttEnabled": true,
|
|
6667
6991
|
"sttLivePolicy": "only-in-use",
|
|
6668
6992
|
"ttsEnabled": false,
|
|
@@ -6690,6 +7014,18 @@ Default property:
|
|
|
6690
7014
|
llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
6691
7015
|
/* LLM main session key */
|
|
6692
7016
|
llmSessionKey?: string | DataLink
|
|
7017
|
+
/* File Search (Vector Store) Enabled */
|
|
7018
|
+
fileSearchEnabled?: boolean | DataLink
|
|
7019
|
+
/* File Search (Vector Store) Generator */
|
|
7020
|
+
fileSearchGeneratorId?: string | DataLink
|
|
7021
|
+
/* File Search (Vector Store) Live Policy. If the policy is `only-in-use`, the File Search (Vector Store) context will be released when the assistant is not in use. */
|
|
7022
|
+
fileSearchLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
7023
|
+
/* File Search Citation Count. (Default: 3) */
|
|
7024
|
+
fileSearchCitationCount?: number | DataLink
|
|
7025
|
+
/* File Search Threshold. (Default: 1.0) */
|
|
7026
|
+
fileSearchThreshold?: number | DataLink
|
|
7027
|
+
/* File Search Ignore Threshold. (Default: false) */
|
|
7028
|
+
fileSearchIgnoreThreshold?: boolean | DataLink
|
|
6693
7029
|
/* STT Generator use for transcribing audio message (Currently only support `STT (GGML)` generator) */
|
|
6694
7030
|
sttGeneratorId?: string | DataLink
|
|
6695
7031
|
/* STT Enabled */
|
|
@@ -6741,8 +7077,14 @@ Default property:
|
|
|
6741
7077
|
outlets?: {
|
|
6742
7078
|
/* Whether the assistant is heating up */
|
|
6743
7079
|
isHeatingUp?: () => Data
|
|
7080
|
+
/* Whether the assistant is file processing */
|
|
7081
|
+
isFileProcessing?: () => Data
|
|
6744
7082
|
/* Whether the assistant is responding */
|
|
6745
7083
|
isResponding?: () => Data
|
|
7084
|
+
/* Whether the assistant is busy */
|
|
7085
|
+
isBusy?: () => Data
|
|
7086
|
+
/* Embedding files of the assistant */
|
|
7087
|
+
files?: () => Data
|
|
6746
7088
|
/* Messages of the assistant */
|
|
6747
7089
|
messages?: () => Data
|
|
6748
7090
|
}
|
|
@@ -6762,7 +7104,235 @@ export type GeneratorAssistant = Generator &
|
|
|
6762
7104
|
| SwitchCondData
|
|
6763
7105
|
| {
|
|
6764
7106
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
6765
|
-
outlet:
|
|
7107
|
+
outlet:
|
|
7108
|
+
| 'isHeatingUp'
|
|
7109
|
+
| 'isFileProcessing'
|
|
7110
|
+
| 'isResponding'
|
|
7111
|
+
| 'isBusy'
|
|
7112
|
+
| 'files'
|
|
7113
|
+
| 'messages'
|
|
7114
|
+
value: any
|
|
7115
|
+
}
|
|
7116
|
+
}>
|
|
7117
|
+
}
|
|
7118
|
+
>
|
|
7119
|
+
}
|
|
7120
|
+
|
|
7121
|
+
/* Load the model (Only if source is ggml) */
|
|
7122
|
+
export type GeneratorVectorStoreActionModelLoad = Action & {
|
|
7123
|
+
__actionName: 'GENERATOR_VECTOR_STORE_MODEL_LOAD'
|
|
7124
|
+
}
|
|
7125
|
+
|
|
7126
|
+
/* Release the model (Only if source is ggml) */
|
|
7127
|
+
export type GeneratorVectorStoreActionModelRelease = Action & {
|
|
7128
|
+
__actionName: 'GENERATOR_VECTOR_STORE_MODEL_RELEASE'
|
|
7129
|
+
}
|
|
7130
|
+
|
|
7131
|
+
/* Reset the embedding session */
|
|
7132
|
+
export type GeneratorVectorStoreActionReset = ActionWithParams & {
|
|
7133
|
+
__actionName: 'GENERATOR_VECTOR_STORE_RESET'
|
|
7134
|
+
params?: Array<{
|
|
7135
|
+
input: 'resetType'
|
|
7136
|
+
value?: 'session' | 'all' | DataLink
|
|
7137
|
+
mapping?: string
|
|
7138
|
+
}>
|
|
7139
|
+
}
|
|
7140
|
+
|
|
7141
|
+
/* Insert file content with path or url, support Office / OpenOffice / PDF
|
|
7142
|
+
|
|
7143
|
+
PDF is not currently supprted in iOS / Android */
|
|
7144
|
+
export type GeneratorVectorStoreActionInsertFile = ActionWithParams & {
|
|
7145
|
+
__actionName: 'GENERATOR_VECTOR_STORE_INSERT_FILE'
|
|
7146
|
+
params?: Array<
|
|
7147
|
+
| {
|
|
7148
|
+
input: 'filePath'
|
|
7149
|
+
value?: string | DataLink
|
|
7150
|
+
mapping?: string
|
|
7151
|
+
}
|
|
7152
|
+
| {
|
|
7153
|
+
input: 'fileName'
|
|
7154
|
+
value?: string | DataLink
|
|
7155
|
+
mapping?: string
|
|
7156
|
+
}
|
|
7157
|
+
| {
|
|
7158
|
+
input: 'fileExtension'
|
|
7159
|
+
value?: string | DataLink
|
|
7160
|
+
mapping?: string
|
|
7161
|
+
}
|
|
7162
|
+
| {
|
|
7163
|
+
input: 'chunkSize'
|
|
7164
|
+
value?: number | DataLink
|
|
7165
|
+
mapping?: string
|
|
7166
|
+
}
|
|
7167
|
+
>
|
|
7168
|
+
}
|
|
7169
|
+
|
|
7170
|
+
/* Cancel the file download */
|
|
7171
|
+
export type GeneratorVectorStoreActionCancelFileDownload = Action & {
|
|
7172
|
+
__actionName: 'GENERATOR_VECTOR_STORE_CANCEL_FILE_DOWNLOAD'
|
|
7173
|
+
}
|
|
7174
|
+
|
|
7175
|
+
/* Insert pure text content to vector store */
|
|
7176
|
+
export type GeneratorVectorStoreActionInsertContent = ActionWithParams & {
|
|
7177
|
+
__actionName: 'GENERATOR_VECTOR_STORE_INSERT_CONTENT'
|
|
7178
|
+
params?: Array<
|
|
7179
|
+
| {
|
|
7180
|
+
input: 'textContent'
|
|
7181
|
+
value?: string | DataLink
|
|
7182
|
+
mapping?: string
|
|
7183
|
+
}
|
|
7184
|
+
| {
|
|
7185
|
+
input: 'fileName'
|
|
7186
|
+
value?: string | DataLink
|
|
7187
|
+
mapping?: string
|
|
7188
|
+
}
|
|
7189
|
+
| {
|
|
7190
|
+
input: 'payload'
|
|
7191
|
+
value?: {} | DataLink
|
|
7192
|
+
mapping?: string
|
|
7193
|
+
}
|
|
7194
|
+
| {
|
|
7195
|
+
input: 'chunkSize'
|
|
7196
|
+
value?: number | DataLink
|
|
7197
|
+
mapping?: string
|
|
7198
|
+
}
|
|
7199
|
+
>
|
|
7200
|
+
}
|
|
7201
|
+
|
|
7202
|
+
/* Remove file from vector store */
|
|
7203
|
+
export type GeneratorVectorStoreActionRemoveFile = ActionWithParams & {
|
|
7204
|
+
__actionName: 'GENERATOR_VECTOR_STORE_REMOVE_FILE'
|
|
7205
|
+
params?: Array<{
|
|
7206
|
+
input: 'fileName'
|
|
7207
|
+
value?: string | DataLink
|
|
7208
|
+
mapping?: string
|
|
7209
|
+
}>
|
|
7210
|
+
}
|
|
7211
|
+
|
|
7212
|
+
/* Search similar text chunks in vector store */
|
|
7213
|
+
export type GeneratorVectorStoreActionSearch = ActionWithParams & {
|
|
7214
|
+
__actionName: 'GENERATOR_VECTOR_STORE_SEARCH'
|
|
7215
|
+
params?: Array<
|
|
7216
|
+
| {
|
|
7217
|
+
input: 'text'
|
|
7218
|
+
value?: string | DataLink
|
|
7219
|
+
mapping?: string
|
|
7220
|
+
}
|
|
7221
|
+
| {
|
|
7222
|
+
input: 'filename'
|
|
7223
|
+
value?: string | DataLink
|
|
7224
|
+
mapping?: string
|
|
7225
|
+
}
|
|
7226
|
+
| {
|
|
7227
|
+
input: 'limit'
|
|
7228
|
+
value?: number | DataLink
|
|
7229
|
+
mapping?: string
|
|
7230
|
+
}
|
|
7231
|
+
| {
|
|
7232
|
+
input: 'threshold'
|
|
7233
|
+
value?: number | DataLink
|
|
7234
|
+
mapping?: string
|
|
7235
|
+
}
|
|
7236
|
+
| {
|
|
7237
|
+
input: 'ignoreThreshold'
|
|
7238
|
+
value?: boolean | DataLink
|
|
7239
|
+
mapping?: string
|
|
7240
|
+
}
|
|
7241
|
+
>
|
|
7242
|
+
}
|
|
7243
|
+
|
|
7244
|
+
interface GeneratorVectorStoreDef {
|
|
7245
|
+
/*
|
|
7246
|
+
Default property:
|
|
7247
|
+
{
|
|
7248
|
+
"source": "ggml",
|
|
7249
|
+
"ggmlContextSize": 512,
|
|
7250
|
+
"openaiBaseUrl": "https://api.openai.com/v1",
|
|
7251
|
+
"openaiModel": "text-embedding-3-small",
|
|
7252
|
+
"embedSessionId": "default-embeddings",
|
|
7253
|
+
"fileChunkSize": 256
|
|
7254
|
+
}
|
|
7255
|
+
*/
|
|
7256
|
+
property?: {
|
|
7257
|
+
/* Initialize embedding model context & tokenizer context on subspace mounted */
|
|
7258
|
+
init?: boolean | DataLink
|
|
7259
|
+
/* Source of embedding model. Note that you can't use the saved embedddings data in different sources. */
|
|
7260
|
+
source?: 'ggml' | 'openai' | DataLink
|
|
7261
|
+
/* Path of ggml model */
|
|
7262
|
+
ggmlModelUrl?: string | DataLink
|
|
7263
|
+
/* Hash type of ggml model */
|
|
7264
|
+
ggmlModelHashType?: 'sha256' | 'sha1' | 'md5' | DataLink
|
|
7265
|
+
/* Hash of ggml model */
|
|
7266
|
+
ggmlModelHash?: string | DataLink
|
|
7267
|
+
/* Size of ggml context */
|
|
7268
|
+
ggmlContextSize?: number | DataLink
|
|
7269
|
+
/* Pooling type of ggml model */
|
|
7270
|
+
ggmlPoolingType?: 'none' | 'mean' | 'cls' | 'last' | 'rank' | DataLink
|
|
7271
|
+
/* Accelerator variant of ggml model */
|
|
7272
|
+
ggmlAccelVariant?: 'default' | 'vulkan' | DataLink
|
|
7273
|
+
/* Normalize */
|
|
7274
|
+
ggmlEmbdNormalize?: number | DataLink
|
|
7275
|
+
/* API key of OpenAI Compatible API */
|
|
7276
|
+
openaiApiKey?: string | DataLink
|
|
7277
|
+
/* Base URL of OpenAI Compatible API. For example, we can use ollama / llama.cpp server instead of openai */
|
|
7278
|
+
openaiBaseUrl?: string | DataLink
|
|
7279
|
+
/* Model of OpenAI Compatible API */
|
|
7280
|
+
openaiModel?: 'text-embedding-3-small' | 'text-embedding-3-large' | DataLink
|
|
7281
|
+
/* Session ID of embedding */
|
|
7282
|
+
embedSessionId?: string | DataLink
|
|
7283
|
+
/* Storage type of embedding */
|
|
7284
|
+
embedStorageType?: 'file' | 'memory' | DataLink
|
|
7285
|
+
/* Tokenizer model URL (Recommended to use same with your LLM model, the model will just load with vocab_only mode) */
|
|
7286
|
+
tokenizerModelUrl?: string | DataLink
|
|
7287
|
+
/* Tokenizer model hash */
|
|
7288
|
+
tokenizerModelHash?: string | DataLink
|
|
7289
|
+
/* Tokenizer model hash type */
|
|
7290
|
+
tokenizerModelHashType?: 'sha256' | 'sha1' | 'md5' | DataLink
|
|
7291
|
+
/* Chunk size to handle file content (token), must be less then embedding model context size */
|
|
7292
|
+
fileChunkSize?: number | DataLink
|
|
7293
|
+
}
|
|
7294
|
+
events?: {
|
|
7295
|
+
/* Event triggered when error occurs */
|
|
7296
|
+
onError?: Array<
|
|
7297
|
+
EventAction & {
|
|
7298
|
+
eventPropertyMapping?: {
|
|
7299
|
+
error: {
|
|
7300
|
+
type: 'string'
|
|
7301
|
+
path: string
|
|
7302
|
+
}
|
|
7303
|
+
}
|
|
7304
|
+
}
|
|
7305
|
+
>
|
|
7306
|
+
}
|
|
7307
|
+
outlets?: {
|
|
7308
|
+
/* undefined */
|
|
7309
|
+
isReady?: () => Data
|
|
7310
|
+
/* Whether the embedding is processing */
|
|
7311
|
+
processing?: () => Data
|
|
7312
|
+
/* Progress of embedding processing */
|
|
7313
|
+
processProgress?: () => Data
|
|
7314
|
+
/* Files inserted to embedding */
|
|
7315
|
+
files?: () => Data
|
|
7316
|
+
/* Search result */
|
|
7317
|
+
searchResult?: () => Data
|
|
7318
|
+
}
|
|
7319
|
+
}
|
|
7320
|
+
|
|
7321
|
+
/* Vector Store - File embeddings & search */
|
|
7322
|
+
export type GeneratorVectorStore = Generator &
|
|
7323
|
+
GeneratorVectorStoreDef & {
|
|
7324
|
+
templateKey: 'GENERATOR_VECTOR_STORE'
|
|
7325
|
+
switches: Array<
|
|
7326
|
+
SwitchDef &
|
|
7327
|
+
GeneratorVectorStoreDef & {
|
|
7328
|
+
conds?: Array<{
|
|
7329
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
7330
|
+
cond:
|
|
7331
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
7332
|
+
| SwitchCondData
|
|
7333
|
+
| {
|
|
7334
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
7335
|
+
outlet: 'isReady' | 'processing' | 'processProgress' | 'files' | 'searchResult'
|
|
6766
7336
|
value: any
|
|
6767
7337
|
}
|
|
6768
7338
|
}>
|
package/utils/data.ts
CHANGED
|
@@ -62,6 +62,7 @@ type SystemDataName =
|
|
|
62
62
|
| 'isWifiEnabled'
|
|
63
63
|
| 'deviceDisplayName'
|
|
64
64
|
| 'workspaceName'
|
|
65
|
+
| 'applicationInfo'
|
|
65
66
|
| 'applicationName'
|
|
66
67
|
| 'macAddress'
|
|
67
68
|
| 'bindDeviceCode'
|
|
@@ -326,6 +327,14 @@ export const systemDataList: Array<SystemDataInfo> = [
|
|
|
326
327
|
type: 'string',
|
|
327
328
|
value: '',
|
|
328
329
|
},
|
|
330
|
+
{
|
|
331
|
+
name: 'applicationInfo',
|
|
332
|
+
id: 'PROPERTY_BANK_DATA_NODE_935d3322-84aa-4465-b1e7-241d1f024267',
|
|
333
|
+
title: 'SYSTEM: Application Info',
|
|
334
|
+
description: 'Current application info',
|
|
335
|
+
type: 'object',
|
|
336
|
+
value: {},
|
|
337
|
+
},
|
|
329
338
|
{
|
|
330
339
|
name: 'applicationName',
|
|
331
340
|
id: 'PROPERTY_BANK_DATA_NODE_df395fd6-a754-4b60-8bac-1360933e6707',
|