@fugood/bricks-project 2.21.7 → 2.21.9
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 +37 -1
- package/package.json +1 -1
- package/types/bricks.ts +102 -1
- package/types/data.ts +6 -0
- package/types/generators.ts +296 -21
- package/utils/event-props.ts +8 -0
|
@@ -142,6 +142,13 @@ export const templateActionNameMap = {
|
|
|
142
142
|
},
|
|
143
143
|
},
|
|
144
144
|
|
|
145
|
+
BRICK_VIDEO: {
|
|
146
|
+
BRICK_VIDEO_SEEK: {
|
|
147
|
+
seekTime: 'BRICK_VIDEO_SEEK_TIME',
|
|
148
|
+
play: 'BRICK_VIDEO_PLAY',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
|
|
145
152
|
BRICK_SLIDESHOW: {
|
|
146
153
|
BRICK_SLIDESHOW_JUMP_TO_INDEX: {
|
|
147
154
|
index: 'BRICK_SLIDESHOW_INDEX',
|
|
@@ -231,7 +238,12 @@ export const templateActionNameMap = {
|
|
|
231
238
|
index: 'BRICK_ITEMS_INDEX',
|
|
232
239
|
},
|
|
233
240
|
},
|
|
234
|
-
|
|
241
|
+
BRICK_LOTTIE: {
|
|
242
|
+
BRICK_LOTTIE_PLAY: {
|
|
243
|
+
startFrame: 'BRICK_LOTTIE_START_FRAME',
|
|
244
|
+
endFrame: 'BRICK_LOTTIE_END_FRAME',
|
|
245
|
+
},
|
|
246
|
+
},
|
|
235
247
|
BRICK_RIVE: {
|
|
236
248
|
BRICK_RIVE_PLAY: {
|
|
237
249
|
animationName: 'BRICK_RIVE_ANIMATION_NAME',
|
|
@@ -257,6 +269,10 @@ export const templateActionNameMap = {
|
|
|
257
269
|
BRICK_WEBVIEW_INJECT_JAVASCRIPT: {
|
|
258
270
|
javascriptCode: 'BRICK_WEBVIEW_JAVASCRIPT_CODE',
|
|
259
271
|
},
|
|
272
|
+
BRICK_WEBVIEW_QUERY_SELECTOR: {
|
|
273
|
+
querySelector: 'BRICK_WEBVIEW_QUERY_SELECTOR',
|
|
274
|
+
expression: 'BRICK_WEBVIEW_EXPRESSION',
|
|
275
|
+
},
|
|
260
276
|
},
|
|
261
277
|
BRICK_CAMERA: {
|
|
262
278
|
BRICK_CAMERA_TAKE_PICTURE: {
|
|
@@ -592,6 +608,15 @@ export const templateActionNameMap = {
|
|
|
592
608
|
},
|
|
593
609
|
},
|
|
594
610
|
GENERATOR_LLM: {
|
|
611
|
+
GENERATOR_LLM_TOKENIZE: {
|
|
612
|
+
mode: 'GENERATOR_LLM_MODE',
|
|
613
|
+
prompt: 'GENERATOR_LLM_PROMPT',
|
|
614
|
+
promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
|
|
615
|
+
messages: 'GENERATOR_LLM_MESSAGES',
|
|
616
|
+
},
|
|
617
|
+
GENERATOR_LLM_DETOKENIZE: {
|
|
618
|
+
tokens: 'GENERATOR_LLM_TOKENS',
|
|
619
|
+
},
|
|
595
620
|
GENERATOR_LLM_PROCESS_PROMPT: {
|
|
596
621
|
sessionKey: 'GENERATOR_LLM_SESSION_KEY',
|
|
597
622
|
mode: 'GENERATOR_LLM_MODE',
|
|
@@ -600,6 +625,7 @@ export const templateActionNameMap = {
|
|
|
600
625
|
parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
|
|
601
626
|
toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
|
|
602
627
|
prompt: 'GENERATOR_LLM_PROMPT',
|
|
628
|
+
promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
|
|
603
629
|
promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
|
|
604
630
|
promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
|
|
605
631
|
responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
|
|
@@ -612,6 +638,7 @@ export const templateActionNameMap = {
|
|
|
612
638
|
parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
|
|
613
639
|
toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
|
|
614
640
|
prompt: 'GENERATOR_LLM_PROMPT',
|
|
641
|
+
promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
|
|
615
642
|
promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
|
|
616
643
|
promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
|
|
617
644
|
responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
|
|
@@ -648,6 +675,11 @@ export const templateActionNameMap = {
|
|
|
648
675
|
sessionCustomKey: 'GENERATOR_LLM_SESSION_CUSTOM_KEY',
|
|
649
676
|
},
|
|
650
677
|
},
|
|
678
|
+
GENERATOR_GGML_TTS: {
|
|
679
|
+
GENERATOR_GGML_TTS_GENERATE: {
|
|
680
|
+
text: 'GENERATOR_GGML_TTS_TEXT',
|
|
681
|
+
},
|
|
682
|
+
},
|
|
651
683
|
GENERATOR_QNN_LLM: {
|
|
652
684
|
GENERATOR_QNN_LLM_GENERATE: {
|
|
653
685
|
prompt: 'GENERATOR_QNN_LLM_PROMPT',
|
|
@@ -679,6 +711,7 @@ export const templateActionNameMap = {
|
|
|
679
711
|
GENERATOR_ASSISTANT_ADD_MESSAGE: {
|
|
680
712
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
681
713
|
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
714
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
682
715
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
683
716
|
useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
|
|
684
717
|
filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
|
|
@@ -702,12 +735,14 @@ export const templateActionNameMap = {
|
|
|
702
735
|
GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX: {
|
|
703
736
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
704
737
|
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
738
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
705
739
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
706
740
|
},
|
|
707
741
|
GENERATOR_ASSISTANT_ADD_AUDIO_MESSAGE: {
|
|
708
742
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
709
743
|
contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
|
|
710
744
|
contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
|
|
745
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
711
746
|
useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
|
|
712
747
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
713
748
|
filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
|
|
@@ -730,6 +765,7 @@ export const templateActionNameMap = {
|
|
|
730
765
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
731
766
|
contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
|
|
732
767
|
contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
|
|
768
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
733
769
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
734
770
|
},
|
|
735
771
|
GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX: {
|
package/package.json
CHANGED
package/types/bricks.ts
CHANGED
|
@@ -865,6 +865,43 @@ export type BrickIcon = Brick &
|
|
|
865
865
|
>
|
|
866
866
|
}
|
|
867
867
|
|
|
868
|
+
/* Play the video */
|
|
869
|
+
export type BrickVideoActionPlay = Action & {
|
|
870
|
+
__actionName: 'BRICK_VIDEO_PLAY'
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/* Seek the video */
|
|
874
|
+
export type BrickVideoActionSeek = ActionWithParams & {
|
|
875
|
+
__actionName: 'BRICK_VIDEO_SEEK'
|
|
876
|
+
params?: Array<
|
|
877
|
+
| {
|
|
878
|
+
input: 'seekTime'
|
|
879
|
+
value?: number | DataLink | EventProperty
|
|
880
|
+
mapping?: string
|
|
881
|
+
}
|
|
882
|
+
| {
|
|
883
|
+
input: 'play'
|
|
884
|
+
value?: boolean | DataLink | EventProperty
|
|
885
|
+
mapping?: string
|
|
886
|
+
}
|
|
887
|
+
>
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/* Pause the video */
|
|
891
|
+
export type BrickVideoActionPause = Action & {
|
|
892
|
+
__actionName: 'BRICK_VIDEO_PAUSE'
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/* Replay the video */
|
|
896
|
+
export type BrickVideoActionReplay = Action & {
|
|
897
|
+
__actionName: 'BRICK_VIDEO_REPLAY'
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/* Stop the video */
|
|
901
|
+
export type BrickVideoActionStop = Action & {
|
|
902
|
+
__actionName: 'BRICK_VIDEO_STOP'
|
|
903
|
+
}
|
|
904
|
+
|
|
868
905
|
interface BrickVideoDef {
|
|
869
906
|
/*
|
|
870
907
|
Default property:
|
|
@@ -2108,6 +2145,43 @@ export type BrickItems = Brick &
|
|
|
2108
2145
|
>
|
|
2109
2146
|
}
|
|
2110
2147
|
|
|
2148
|
+
/* Play animation */
|
|
2149
|
+
export type BrickLottieActionPlay = ActionWithParams & {
|
|
2150
|
+
__actionName: 'BRICK_LOTTIE_PLAY'
|
|
2151
|
+
params?: Array<
|
|
2152
|
+
| {
|
|
2153
|
+
input: 'startFrame'
|
|
2154
|
+
value?: number | DataLink | EventProperty
|
|
2155
|
+
mapping?: string
|
|
2156
|
+
}
|
|
2157
|
+
| {
|
|
2158
|
+
input: 'endFrame'
|
|
2159
|
+
value?: number | DataLink | EventProperty
|
|
2160
|
+
mapping?: string
|
|
2161
|
+
}
|
|
2162
|
+
>
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
/* Pause animation */
|
|
2166
|
+
export type BrickLottieActionPause = Action & {
|
|
2167
|
+
__actionName: 'BRICK_LOTTIE_PAUSE'
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
/* Resume animation */
|
|
2171
|
+
export type BrickLottieActionResume = Action & {
|
|
2172
|
+
__actionName: 'BRICK_LOTTIE_RESUME'
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
/* Stop animation */
|
|
2176
|
+
export type BrickLottieActionStop = Action & {
|
|
2177
|
+
__actionName: 'BRICK_LOTTIE_STOP'
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
/* Reset animation */
|
|
2181
|
+
export type BrickLottieActionReset = Action & {
|
|
2182
|
+
__actionName: 'BRICK_LOTTIE_RESET'
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2111
2185
|
interface BrickLottieDef {
|
|
2112
2186
|
/*
|
|
2113
2187
|
Default property:
|
|
@@ -2420,6 +2494,23 @@ export type BrickWebViewActionInjectJavascript = ActionWithParams & {
|
|
|
2420
2494
|
}>
|
|
2421
2495
|
}
|
|
2422
2496
|
|
|
2497
|
+
/* Query selector on the WebView */
|
|
2498
|
+
export type BrickWebViewActionQuerySelector = ActionWithParams & {
|
|
2499
|
+
__actionName: 'BRICK_WEBVIEW_QUERY_SELECTOR'
|
|
2500
|
+
params?: Array<
|
|
2501
|
+
| {
|
|
2502
|
+
input: 'querySelector'
|
|
2503
|
+
value?: string | DataLink | EventProperty
|
|
2504
|
+
mapping?: string
|
|
2505
|
+
}
|
|
2506
|
+
| {
|
|
2507
|
+
input: 'expression'
|
|
2508
|
+
value?: string | DataLink | EventProperty
|
|
2509
|
+
mapping?: string
|
|
2510
|
+
}
|
|
2511
|
+
>
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2423
2514
|
/* Do go forward on the WebView */
|
|
2424
2515
|
export type BrickWebViewActionGoForward = Action & {
|
|
2425
2516
|
__actionName: 'BRICK_WEBVIEW_GO_FORWARD'
|
|
@@ -2502,6 +2593,12 @@ Default property:
|
|
|
2502
2593
|
/* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
|
|
2503
2594
|
onMessage?: Array<EventAction>
|
|
2504
2595
|
}
|
|
2596
|
+
outlets?: {
|
|
2597
|
+
/* The result of the query selector action */
|
|
2598
|
+
queryResult?: () => Data
|
|
2599
|
+
/* The error of the query selector action */
|
|
2600
|
+
queryError?: () => Data
|
|
2601
|
+
}
|
|
2505
2602
|
animation?: AnimationBasicEvents & {
|
|
2506
2603
|
onLoad?: Animation
|
|
2507
2604
|
onError?: Animation
|
|
@@ -2523,7 +2620,7 @@ export type BrickWebView = Brick &
|
|
|
2523
2620
|
| SwitchCondData
|
|
2524
2621
|
| {
|
|
2525
2622
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
2526
|
-
outlet: ''
|
|
2623
|
+
outlet: 'queryResult' | 'queryError'
|
|
2527
2624
|
value: any
|
|
2528
2625
|
}
|
|
2529
2626
|
}>
|
|
@@ -2967,6 +3064,10 @@ Default property:
|
|
|
2967
3064
|
type?: 'image' | 'video' | DataLink
|
|
2968
3065
|
/* Default image to display when no generated image is available */
|
|
2969
3066
|
defaultImage?: string | DataLink
|
|
3067
|
+
/* The hash of the default image */
|
|
3068
|
+
defaultImageHash?: string | DataLink
|
|
3069
|
+
/* The type of the default image hash */
|
|
3070
|
+
defaultImageHashType?: 'md5' | 'sha1' | 'sha256' | DataLink
|
|
2970
3071
|
/* The Lottie animation to show while generating */
|
|
2971
3072
|
loadingAnimation?: string | DataLink
|
|
2972
3073
|
/* The Lottie animation to show when an error occurs */
|
package/types/data.ts
CHANGED
|
@@ -56,6 +56,11 @@ export type Data<T = any> = DataDef & {
|
|
|
56
56
|
| 'rich-text-content'
|
|
57
57
|
| 'sandbox-script'
|
|
58
58
|
| 'llm-prompt'
|
|
59
|
+
| 'llm-messages'
|
|
60
|
+
| 'llm-tools'
|
|
61
|
+
| 'mcp-server-resources'
|
|
62
|
+
| 'mcp-server-tools'
|
|
63
|
+
| 'mcp-server-prompts'
|
|
59
64
|
}
|
|
60
65
|
value: T
|
|
61
66
|
}
|
|
@@ -67,6 +72,7 @@ export type DataAssetKind = {
|
|
|
67
72
|
| 'media-resource-audio'
|
|
68
73
|
| 'media-resource-file'
|
|
69
74
|
| 'lottie-file-uri'
|
|
75
|
+
| 'rive-file-uri'
|
|
70
76
|
| 'ggml-model-asset'
|
|
71
77
|
| 'gguf-model-asset'
|
|
72
78
|
| 'binary-asset'
|
package/types/generators.ts
CHANGED
|
@@ -4848,6 +4848,10 @@ Default property:
|
|
|
4848
4848
|
"model": "BricksDisplay/vits-eng",
|
|
4849
4849
|
"modelType": "auto",
|
|
4850
4850
|
"vocoderModel": "speecht5_hifigan",
|
|
4851
|
+
"maxLength": 4096,
|
|
4852
|
+
"temperature": 0.1,
|
|
4853
|
+
"repetitionPenalty": 1.1,
|
|
4854
|
+
"doSample": true,
|
|
4851
4855
|
"outputType": "play",
|
|
4852
4856
|
"cacheGenerated": true,
|
|
4853
4857
|
"autoInferEnable": false,
|
|
@@ -4866,6 +4870,7 @@ Default property:
|
|
|
4866
4870
|
| 'BricksDisplay/vits-eng'
|
|
4867
4871
|
| 'BricksDisplay/vits-cmn'
|
|
4868
4872
|
| 'BricksDisplay/ellie-Bert-VITS2'
|
|
4873
|
+
| 'onnx-community/OuteTTS-1.0-0.6B-ONNX'
|
|
4869
4874
|
| 'mms-tts-ara (NC)'
|
|
4870
4875
|
| 'mms-tts-deu (NC)'
|
|
4871
4876
|
| 'mms-tts-eng (NC)'
|
|
@@ -4881,7 +4886,7 @@ Default property:
|
|
|
4881
4886
|
| 'speecht5_tts'
|
|
4882
4887
|
| DataLink
|
|
4883
4888
|
/* Model type */
|
|
4884
|
-
modelType?: 'auto' | 'vits' | 'bert_vits2' | 'speecht5' | DataLink
|
|
4889
|
+
modelType?: 'auto' | 'vits' | 'bert_vits2' | 'speecht5' | 'outetts-1.0' | DataLink
|
|
4885
4890
|
/* Load quantized model (deprecated, use `quantizeType` instead) */
|
|
4886
4891
|
quantized?: boolean | DataLink
|
|
4887
4892
|
/* Quantize type */
|
|
@@ -4908,6 +4913,16 @@ Default property:
|
|
|
4908
4913
|
speakerEmbedUrl?: string | DataLink
|
|
4909
4914
|
/* MD5 checksum of `speakerEmbedUrl` */
|
|
4910
4915
|
speakerEmbedMd5?: string | DataLink
|
|
4916
|
+
/* Speaker config, for OuteTTS model */
|
|
4917
|
+
speakerConfig?: {} | DataLink
|
|
4918
|
+
/* Audio token generation max length */
|
|
4919
|
+
maxLength?: number | DataLink
|
|
4920
|
+
/* Audio token generation temperature */
|
|
4921
|
+
temperature?: number | DataLink
|
|
4922
|
+
/* Audio token generation repetition penalty */
|
|
4923
|
+
repetitionPenalty?: number | DataLink
|
|
4924
|
+
/* Use greedy sampling for audio token generation */
|
|
4925
|
+
doSample?: boolean | DataLink
|
|
4911
4926
|
/* Output mode */
|
|
4912
4927
|
outputType?: 'play' | 'file' | DataLink
|
|
4913
4928
|
/* Enable cache for generated audio */
|
|
@@ -5092,24 +5107,19 @@ Default property:
|
|
|
5092
5107
|
/* Model type */
|
|
5093
5108
|
modelType?:
|
|
5094
5109
|
| 'auto'
|
|
5095
|
-
| '
|
|
5096
|
-
| '
|
|
5097
|
-
| '
|
|
5098
|
-
| '
|
|
5099
|
-
| '
|
|
5100
|
-
| '
|
|
5101
|
-
| '
|
|
5102
|
-
| '
|
|
5103
|
-
| '
|
|
5104
|
-
| '
|
|
5105
|
-
| 'mistral'
|
|
5110
|
+
| 'text-generation'
|
|
5111
|
+
| 'qwen2-vl'
|
|
5112
|
+
| 'paligemma'
|
|
5113
|
+
| 'llava'
|
|
5114
|
+
| 'llava_onevision'
|
|
5115
|
+
| 'moondream1'
|
|
5116
|
+
| 'florence2'
|
|
5117
|
+
| 'idefics3'
|
|
5118
|
+
| 'smolvlm'
|
|
5119
|
+
| 'phi3_v'
|
|
5106
5120
|
| 't5'
|
|
5107
5121
|
| 'mt5'
|
|
5108
5122
|
| 'longt5'
|
|
5109
|
-
| 'phi'
|
|
5110
|
-
| 'qwen2'
|
|
5111
|
-
| 'stablelm'
|
|
5112
|
-
| 'gemma'
|
|
5113
5123
|
| DataLink
|
|
5114
5124
|
/* Load quantized model (deprecated, use `quantizeType` instead) */
|
|
5115
5125
|
quantized?: boolean | DataLink
|
|
@@ -5902,6 +5912,48 @@ export type GeneratorLLMActionLoadModel = Action & {
|
|
|
5902
5912
|
__actionName: 'GENERATOR_LLM_LOAD_MODEL'
|
|
5903
5913
|
}
|
|
5904
5914
|
|
|
5915
|
+
/* Load multimodal (vision) model (PREVIEW FEATURE) */
|
|
5916
|
+
export type GeneratorLLMActionLoadMultimodalModel = Action & {
|
|
5917
|
+
__actionName: 'GENERATOR_LLM_LOAD_MULTIMODAL_MODEL'
|
|
5918
|
+
}
|
|
5919
|
+
|
|
5920
|
+
/* Tokenize the prompt */
|
|
5921
|
+
export type GeneratorLLMActionTokenize = ActionWithParams & {
|
|
5922
|
+
__actionName: 'GENERATOR_LLM_TOKENIZE'
|
|
5923
|
+
params?: Array<
|
|
5924
|
+
| {
|
|
5925
|
+
input: 'mode'
|
|
5926
|
+
value?: string | DataLink | EventProperty
|
|
5927
|
+
mapping?: string
|
|
5928
|
+
}
|
|
5929
|
+
| {
|
|
5930
|
+
input: 'prompt'
|
|
5931
|
+
value?: string | DataLink | EventProperty
|
|
5932
|
+
mapping?: string
|
|
5933
|
+
}
|
|
5934
|
+
| {
|
|
5935
|
+
input: 'promptMediaPaths'
|
|
5936
|
+
value?: Array<any> | DataLink | EventProperty
|
|
5937
|
+
mapping?: string
|
|
5938
|
+
}
|
|
5939
|
+
| {
|
|
5940
|
+
input: 'messages'
|
|
5941
|
+
value?: Array<any> | DataLink | EventProperty
|
|
5942
|
+
mapping?: string
|
|
5943
|
+
}
|
|
5944
|
+
>
|
|
5945
|
+
}
|
|
5946
|
+
|
|
5947
|
+
/* Detokenize the tokens to text */
|
|
5948
|
+
export type GeneratorLLMActionDetokenize = ActionWithParams & {
|
|
5949
|
+
__actionName: 'GENERATOR_LLM_DETOKENIZE'
|
|
5950
|
+
params?: Array<{
|
|
5951
|
+
input: 'tokens'
|
|
5952
|
+
value?: Array<any> | DataLink | EventProperty
|
|
5953
|
+
mapping?: string
|
|
5954
|
+
}>
|
|
5955
|
+
}
|
|
5956
|
+
|
|
5905
5957
|
/* Pre-process the prompt, this can speed up the completion action */
|
|
5906
5958
|
export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
|
|
5907
5959
|
__actionName: 'GENERATOR_LLM_PROCESS_PROMPT'
|
|
@@ -5941,6 +5993,11 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
|
|
|
5941
5993
|
value?: string | DataLink | EventProperty
|
|
5942
5994
|
mapping?: string
|
|
5943
5995
|
}
|
|
5996
|
+
| {
|
|
5997
|
+
input: 'promptMediaPaths'
|
|
5998
|
+
value?: Array<any> | DataLink | EventProperty
|
|
5999
|
+
mapping?: string
|
|
6000
|
+
}
|
|
5944
6001
|
| {
|
|
5945
6002
|
input: 'promptTemplateData'
|
|
5946
6003
|
value?: {} | DataLink | EventProperty
|
|
@@ -5998,6 +6055,11 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
|
|
|
5998
6055
|
value?: string | DataLink | EventProperty
|
|
5999
6056
|
mapping?: string
|
|
6000
6057
|
}
|
|
6058
|
+
| {
|
|
6059
|
+
input: 'promptMediaPaths'
|
|
6060
|
+
value?: Array<any> | DataLink | EventProperty
|
|
6061
|
+
mapping?: string
|
|
6062
|
+
}
|
|
6001
6063
|
| {
|
|
6002
6064
|
input: 'promptTemplateData'
|
|
6003
6065
|
value?: {} | DataLink | EventProperty
|
|
@@ -6178,6 +6240,11 @@ export type GeneratorLLMActionClearDownload = Action & {
|
|
|
6178
6240
|
__actionName: 'GENERATOR_LLM_CLEAR_DOWNLOAD'
|
|
6179
6241
|
}
|
|
6180
6242
|
|
|
6243
|
+
/* Release multimodal (vision) context (PREVIEW FEATURE) */
|
|
6244
|
+
export type GeneratorLLMActionReleaseMultimodalContext = Action & {
|
|
6245
|
+
__actionName: 'GENERATOR_LLM_RELEASE_MULTIMODAL_CONTEXT'
|
|
6246
|
+
}
|
|
6247
|
+
|
|
6181
6248
|
/* Release context */
|
|
6182
6249
|
export type GeneratorLLMActionReleaseContext = Action & {
|
|
6183
6250
|
__actionName: 'GENERATOR_LLM_RELEASE_CONTEXT'
|
|
@@ -6255,6 +6322,14 @@ Default property:
|
|
|
6255
6322
|
modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
|
|
6256
6323
|
/* Hash of model */
|
|
6257
6324
|
modelHash?: string | DataLink
|
|
6325
|
+
/* Load multimodal (vision) context after model loaded (PREVIEW FEATURE) */
|
|
6326
|
+
initMultimodal?: boolean | DataLink
|
|
6327
|
+
/* The URL or path of mmproj file for multimodal vision support (PREVIEW FEATURE) */
|
|
6328
|
+
mmprojUrl?: string | DataLink
|
|
6329
|
+
/* Hash type of mmproj file (PREVIEW FEATURE) */
|
|
6330
|
+
mmprojHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
|
|
6331
|
+
/* Hash of mmproj file (PREVIEW FEATURE) */
|
|
6332
|
+
mmprojHash?: string | DataLink
|
|
6258
6333
|
/* Chat Template (Jinja format) to override the default template from model */
|
|
6259
6334
|
chatTemplate?: string | DataLink
|
|
6260
6335
|
/* Context size (0 ~ 4096) (Default to 512) */
|
|
@@ -6324,6 +6399,9 @@ Default property:
|
|
|
6324
6399
|
| DataLink
|
|
6325
6400
|
/* Prompt (text mode) */
|
|
6326
6401
|
completionPrompt?: string | DataLink
|
|
6402
|
+
/* Media paths to be used in the prompt template (PREVIEW FEATURE)
|
|
6403
|
+
In prompt, use `<__media__>` for position of media content */
|
|
6404
|
+
completionPromptMediaPaths?: Array<string | DataLink> | DataLink
|
|
6327
6405
|
/* Data to be used in the prompt template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */
|
|
6328
6406
|
completionPromptTemplateData?: {} | DataLink
|
|
6329
6407
|
/* The prompt template type */
|
|
@@ -6421,6 +6499,10 @@ Default property:
|
|
|
6421
6499
|
sessions?: () => Data
|
|
6422
6500
|
/* Is evaluating */
|
|
6423
6501
|
isEvaluating?: () => Data
|
|
6502
|
+
/* Tokenize result */
|
|
6503
|
+
tokenizeResult?: () => Data
|
|
6504
|
+
/* Detokenize result */
|
|
6505
|
+
detokenizeResult?: () => Data
|
|
6424
6506
|
/* Last formatted prompt (messages or prompt) */
|
|
6425
6507
|
completionLastFormattedPrompt?: () => Data
|
|
6426
6508
|
/* Last completion token */
|
|
@@ -6461,6 +6543,8 @@ export type GeneratorLLM = Generator &
|
|
|
6461
6543
|
| 'contextDetails'
|
|
6462
6544
|
| 'sessions'
|
|
6463
6545
|
| 'isEvaluating'
|
|
6546
|
+
| 'tokenizeResult'
|
|
6547
|
+
| 'detokenizeResult'
|
|
6464
6548
|
| 'completionLastFormattedPrompt'
|
|
6465
6549
|
| 'completionLastToken'
|
|
6466
6550
|
| 'completionResult'
|
|
@@ -6473,6 +6557,165 @@ export type GeneratorLLM = Generator &
|
|
|
6473
6557
|
>
|
|
6474
6558
|
}
|
|
6475
6559
|
|
|
6560
|
+
/* Load the model */
|
|
6561
|
+
export type GeneratorGGMLTTSActionLoadModel = Action & {
|
|
6562
|
+
__actionName: 'GENERATOR_GGML_TTS_LOAD_MODEL'
|
|
6563
|
+
}
|
|
6564
|
+
|
|
6565
|
+
/* Generate audio */
|
|
6566
|
+
export type GeneratorGGMLTTSActionGenerate = ActionWithParams & {
|
|
6567
|
+
__actionName: 'GENERATOR_GGML_TTS_GENERATE'
|
|
6568
|
+
params?: Array<{
|
|
6569
|
+
input: 'text'
|
|
6570
|
+
value?: string | DataLink | EventProperty
|
|
6571
|
+
mapping?: string
|
|
6572
|
+
}>
|
|
6573
|
+
}
|
|
6574
|
+
|
|
6575
|
+
/* Clean cache */
|
|
6576
|
+
export type GeneratorGGMLTTSActionCleanCache = Action & {
|
|
6577
|
+
__actionName: 'GENERATOR_GGML_TTS_CLEAN_CACHE'
|
|
6578
|
+
}
|
|
6579
|
+
|
|
6580
|
+
/* Release context */
|
|
6581
|
+
export type GeneratorGGMLTTSActionReleaseContext = Action & {
|
|
6582
|
+
__actionName: 'GENERATOR_GGML_TTS_RELEASE_CONTEXT'
|
|
6583
|
+
}
|
|
6584
|
+
|
|
6585
|
+
interface GeneratorGGMLTTSDef {
|
|
6586
|
+
/*
|
|
6587
|
+
Default property:
|
|
6588
|
+
{
|
|
6589
|
+
"vocoderUrl": "https://huggingface.co/ggml-org/WavTokenizer/resolve/main/WavTokenizer-Large-75-F16.gguf",
|
|
6590
|
+
"vocoderHashType": "sha256",
|
|
6591
|
+
"vocoderHash": "2356baa8631cc2995ea3465196a017a2733600d849a91180c0f97fa7fb375bbe",
|
|
6592
|
+
"outputType": "play",
|
|
6593
|
+
"cacheGenerated": true,
|
|
6594
|
+
"autoInferEnable": false,
|
|
6595
|
+
"softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
|
|
6596
|
+
"hardBreakTime": 500,
|
|
6597
|
+
"completionTemperature": 0.1,
|
|
6598
|
+
"completionRepetitionPenalty": 1.1,
|
|
6599
|
+
"completionTopK": 40,
|
|
6600
|
+
"completionTopP": 0.9,
|
|
6601
|
+
"completionMinP": 0.05,
|
|
6602
|
+
"useGuideToken": false,
|
|
6603
|
+
"contextSize": 4096,
|
|
6604
|
+
"batchSize": 512,
|
|
6605
|
+
"maxThreads": 1,
|
|
6606
|
+
"accelVariant": "default",
|
|
6607
|
+
"mainGpu": 0,
|
|
6608
|
+
"gpuLayers": 0,
|
|
6609
|
+
"useMlock": true,
|
|
6610
|
+
"useMmap": true,
|
|
6611
|
+
"useFlashAttn": false
|
|
6612
|
+
}
|
|
6613
|
+
*/
|
|
6614
|
+
property?: {
|
|
6615
|
+
/* Initialize the TTS context on generator initialization */
|
|
6616
|
+
init?: boolean | DataLink
|
|
6617
|
+
/* The URL or path of model
|
|
6618
|
+
We used GGUF format model, please refer to https://github.com/ggerganov/llama.cpp/tree/master#description */
|
|
6619
|
+
modelUrl?: string | DataLink
|
|
6620
|
+
/* Hash type of model */
|
|
6621
|
+
modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
|
|
6622
|
+
/* Hash of model */
|
|
6623
|
+
modelHash?: string | DataLink
|
|
6624
|
+
/* The URL or path of vocoder model */
|
|
6625
|
+
vocoderUrl?: string | DataLink
|
|
6626
|
+
/* Hash type of vocoder model */
|
|
6627
|
+
vocoderHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
|
|
6628
|
+
/* Hash of vocoder model */
|
|
6629
|
+
vocoderHash?: string | DataLink
|
|
6630
|
+
/* Output mode */
|
|
6631
|
+
outputType?: 'play' | 'file' | DataLink
|
|
6632
|
+
/* Enable cache for generated audio */
|
|
6633
|
+
cacheGenerated?: boolean | DataLink
|
|
6634
|
+
/* Text to generate */
|
|
6635
|
+
prompt?: string | DataLink
|
|
6636
|
+
/* Speaker JSON */
|
|
6637
|
+
speaker?: {} | DataLink
|
|
6638
|
+
/* Auto inference when prompt changes */
|
|
6639
|
+
autoInferEnable?: boolean | DataLink
|
|
6640
|
+
/* Segmentation rule for auto inference */
|
|
6641
|
+
softBreakRegex?: string | DataLink
|
|
6642
|
+
/* Time to force inference when softBreakRegex is not satisfied */
|
|
6643
|
+
hardBreakTime?: number | DataLink
|
|
6644
|
+
/* Temperature */
|
|
6645
|
+
completionTemperature?: number | DataLink
|
|
6646
|
+
/* Repetition Penalty */
|
|
6647
|
+
completionRepetitionPenalty?: number | DataLink
|
|
6648
|
+
/* Top K sampling */
|
|
6649
|
+
completionTopK?: number | DataLink
|
|
6650
|
+
/* Top P sampling */
|
|
6651
|
+
completionTopP?: number | DataLink
|
|
6652
|
+
/* Min P sampling */
|
|
6653
|
+
completionMinP?: number | DataLink
|
|
6654
|
+
/* Set the random number generator (RNG) seed (default: -1, -1 = random seed) */
|
|
6655
|
+
completionSeed?: number | DataLink
|
|
6656
|
+
/* Enable guide token to help prevent hallucinations by forcing the TTS to use the correct words. */
|
|
6657
|
+
useGuideToken?: boolean | DataLink
|
|
6658
|
+
/* Context size, for OutTTS recommended 4096 ~ 8192 (Default to 4096) */
|
|
6659
|
+
contextSize?: number | DataLink
|
|
6660
|
+
/* Logical batch size for prompt processing */
|
|
6661
|
+
batchSize?: number | DataLink
|
|
6662
|
+
/* Number of threads */
|
|
6663
|
+
maxThreads?: number | DataLink
|
|
6664
|
+
/* Accelerator variant (Only for desktop)
|
|
6665
|
+
`default` - CPU / Metal (macOS)
|
|
6666
|
+
`vulkan` - Use Vulkan
|
|
6667
|
+
`cuda` - Use CUDA */
|
|
6668
|
+
accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
|
|
6669
|
+
/* Main GPU index */
|
|
6670
|
+
mainGpu?: number | DataLink
|
|
6671
|
+
/* Number of GPU layers (NOTE: Currently not supported for Android) */
|
|
6672
|
+
gpuLayers?: number | DataLink
|
|
6673
|
+
/* Use memory lock */
|
|
6674
|
+
useMlock?: boolean | DataLink
|
|
6675
|
+
/* Use mmap */
|
|
6676
|
+
useMmap?: boolean | DataLink
|
|
6677
|
+
/* Use Flash Attention for inference (Recommended with GPU enabled) */
|
|
6678
|
+
useFlashAttn?: boolean | DataLink
|
|
6679
|
+
}
|
|
6680
|
+
events?: {
|
|
6681
|
+
/* Event triggered when state change */
|
|
6682
|
+
onContextStateChange?: Array<EventAction>
|
|
6683
|
+
/* Event triggered when error occurs */
|
|
6684
|
+
onError?: Array<EventAction>
|
|
6685
|
+
}
|
|
6686
|
+
outlets?: {
|
|
6687
|
+
/* Context state */
|
|
6688
|
+
contextState?: () => Data
|
|
6689
|
+
/* Generated audio file */
|
|
6690
|
+
generatedAudio?: () => Data
|
|
6691
|
+
/* Generated audio file is playing */
|
|
6692
|
+
generatedAudioPlaying?: () => Data
|
|
6693
|
+
}
|
|
6694
|
+
}
|
|
6695
|
+
|
|
6696
|
+
/* Local Text-to-Speech (TTS) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
|
|
6697
|
+
You can use any converted model on HuggingFace. */
|
|
6698
|
+
export type GeneratorGGMLTTS = Generator &
|
|
6699
|
+
GeneratorGGMLTTSDef & {
|
|
6700
|
+
templateKey: 'GENERATOR_GGML_TTS'
|
|
6701
|
+
switches: Array<
|
|
6702
|
+
SwitchDef &
|
|
6703
|
+
GeneratorGGMLTTSDef & {
|
|
6704
|
+
conds?: Array<{
|
|
6705
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
6706
|
+
cond:
|
|
6707
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
6708
|
+
| SwitchCondData
|
|
6709
|
+
| {
|
|
6710
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
6711
|
+
outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
|
|
6712
|
+
value: any
|
|
6713
|
+
}
|
|
6714
|
+
}>
|
|
6715
|
+
}
|
|
6716
|
+
>
|
|
6717
|
+
}
|
|
6718
|
+
|
|
6476
6719
|
/* Load the model */
|
|
6477
6720
|
export type GeneratorQnnLlmActionLoadModel = Action & {
|
|
6478
6721
|
__actionName: 'GENERATOR_QNN_LLM_LOAD_MODEL'
|
|
@@ -6521,6 +6764,7 @@ Default property:
|
|
|
6521
6764
|
{
|
|
6522
6765
|
"modelType": "Llama 3.2 3B Chat",
|
|
6523
6766
|
"chatFormat": "Llama 3.x",
|
|
6767
|
+
"toolsInUserMessage": true,
|
|
6524
6768
|
"toolCallParser": "llama3_json",
|
|
6525
6769
|
"toolChoice": "auto",
|
|
6526
6770
|
"parallelToolCalls": false,
|
|
@@ -6549,9 +6793,18 @@ Default property:
|
|
|
6549
6793
|
/* Custom model split parts */
|
|
6550
6794
|
customModelSplitParts?: number | DataLink
|
|
6551
6795
|
/* Chat format */
|
|
6552
|
-
chatFormat?:
|
|
6796
|
+
chatFormat?:
|
|
6797
|
+
| 'Llama 2'
|
|
6798
|
+
| 'Llama 3'
|
|
6799
|
+
| 'Llama 3.x'
|
|
6800
|
+
| 'Mistral v0.3'
|
|
6801
|
+
| 'Qwen 2'
|
|
6802
|
+
| 'Custom'
|
|
6803
|
+
| DataLink
|
|
6553
6804
|
/* Custom chat format template */
|
|
6554
6805
|
customChatFormat?: string | DataLink
|
|
6806
|
+
/* Put tools in user message */
|
|
6807
|
+
toolsInUserMessage?: boolean | DataLink
|
|
6555
6808
|
/* Prompt to generate */
|
|
6556
6809
|
prompt?: string | DataLink
|
|
6557
6810
|
/* Chat messages */
|
|
@@ -6712,7 +6965,7 @@ interface GeneratorOpenAILLMDef {
|
|
|
6712
6965
|
Default property:
|
|
6713
6966
|
{
|
|
6714
6967
|
"apiEndpoint": "https://api.openai.com/v1",
|
|
6715
|
-
"model": "gpt-4o
|
|
6968
|
+
"model": "gpt-4o",
|
|
6716
6969
|
"completionMessages": [
|
|
6717
6970
|
{
|
|
6718
6971
|
"role": "system",
|
|
@@ -6722,8 +6975,6 @@ Default property:
|
|
|
6722
6975
|
"completionMaxTokens": 1024,
|
|
6723
6976
|
"completionTemperature": 1,
|
|
6724
6977
|
"completionTopP": 1,
|
|
6725
|
-
"completionFrequencyPenalty": 0,
|
|
6726
|
-
"completionPresencePenalty": 0,
|
|
6727
6978
|
"completionStop": []
|
|
6728
6979
|
}
|
|
6729
6980
|
*/
|
|
@@ -6812,7 +7063,11 @@ Default property:
|
|
|
6812
7063
|
- Compatible with OpenAI API format
|
|
6813
7064
|
- Supports function calling
|
|
6814
7065
|
- Streaming responses
|
|
6815
|
-
- Custom API endpoints
|
|
7066
|
+
- Custom API endpoints, like
|
|
7067
|
+
- OpenAI API: https://platform.openai.com/docs/guides/text?api-mode=chat
|
|
7068
|
+
- Anthropic API: https://docs.anthropic.com/en/api/openai-sdk
|
|
7069
|
+
- Gemini API: https://ai.google.dev/gemini-api/docs/openai
|
|
7070
|
+
- llama.cpp server: https://github.com/ggml-org/llama.cpp/tree/master/tools/server */
|
|
6816
7071
|
export type GeneratorOpenAILLM = Generator &
|
|
6817
7072
|
GeneratorOpenAILLMDef & {
|
|
6818
7073
|
templateKey: 'GENERATOR_OPENAI_LLM'
|
|
@@ -6946,6 +7201,11 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
|
6946
7201
|
value?: string | DataLink | EventProperty
|
|
6947
7202
|
mapping?: string
|
|
6948
7203
|
}
|
|
7204
|
+
| {
|
|
7205
|
+
input: 'image'
|
|
7206
|
+
value?: string | DataLink | EventProperty
|
|
7207
|
+
mapping?: string
|
|
7208
|
+
}
|
|
6949
7209
|
| {
|
|
6950
7210
|
input: 'payload'
|
|
6951
7211
|
value?: {} | DataLink | EventProperty
|
|
@@ -7052,6 +7312,11 @@ export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
|
|
|
7052
7312
|
value?: string | DataLink | EventProperty
|
|
7053
7313
|
mapping?: string
|
|
7054
7314
|
}
|
|
7315
|
+
| {
|
|
7316
|
+
input: 'image'
|
|
7317
|
+
value?: string | DataLink | EventProperty
|
|
7318
|
+
mapping?: string
|
|
7319
|
+
}
|
|
7055
7320
|
| {
|
|
7056
7321
|
input: 'payload'
|
|
7057
7322
|
value?: {} | DataLink | EventProperty
|
|
@@ -7079,6 +7344,11 @@ export type GeneratorAssistantActionAddAudioMessage = ActionWithParams & {
|
|
|
7079
7344
|
value?: string | DataLink | EventProperty
|
|
7080
7345
|
mapping?: string
|
|
7081
7346
|
}
|
|
7347
|
+
| {
|
|
7348
|
+
input: 'image'
|
|
7349
|
+
value?: string | DataLink | EventProperty
|
|
7350
|
+
mapping?: string
|
|
7351
|
+
}
|
|
7082
7352
|
| {
|
|
7083
7353
|
input: 'useFileSearch'
|
|
7084
7354
|
value?: boolean | DataLink | EventProperty
|
|
@@ -7178,6 +7448,11 @@ export type GeneratorAssistantActionUpdateAudioMessageAtIndex = ActionWithParams
|
|
|
7178
7448
|
value?: string | DataLink | EventProperty
|
|
7179
7449
|
mapping?: string
|
|
7180
7450
|
}
|
|
7451
|
+
| {
|
|
7452
|
+
input: 'image'
|
|
7453
|
+
value?: string | DataLink | EventProperty
|
|
7454
|
+
mapping?: string
|
|
7455
|
+
}
|
|
7181
7456
|
| {
|
|
7182
7457
|
input: 'payload'
|
|
7183
7458
|
value?: {} | DataLink | EventProperty
|
package/utils/event-props.ts
CHANGED
|
@@ -806,6 +806,14 @@ export const templateEventPropsMap = {
|
|
|
806
806
|
'GENERATOR_LLM_COMPLETION_FUNCTION_DETAILS', // type: object
|
|
807
807
|
],
|
|
808
808
|
},
|
|
809
|
+
GENERATOR_GGML_TTS: {
|
|
810
|
+
onContextStateChange: [
|
|
811
|
+
'GENERATOR_GGML_TTS_CONTEXT_STATE', // type: string
|
|
812
|
+
],
|
|
813
|
+
onError: [
|
|
814
|
+
'GENERATOR_GGML_TTS_ERROR', // type: string
|
|
815
|
+
],
|
|
816
|
+
},
|
|
809
817
|
GENERATOR_QNN_LLM: {
|
|
810
818
|
onContextStateChange: [
|
|
811
819
|
'GENERATOR_QNN_LLM_CONTEXT_STATE', // type: string
|