@fugood/bricks-project 2.22.0-beta.10 → 2.22.0-beta.12

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.
@@ -552,6 +552,8 @@ export const templateActionNameMap = {
552
552
  prompt: 'GENERATOR_ONNX_LLM_PROMPT',
553
553
  chat: 'GENERATOR_ONNX_LLM_CHAT',
554
554
  images: 'GENERATOR_ONNX_LLM_IMAGES',
555
+ tools: 'GENERATOR_ONNX_LLM_TOOLS',
556
+ toolChoice: 'GENERATOR_ONNX_LLM_TOOL_CHOICE',
555
557
  },
556
558
  },
557
559
  GENERATOR_ONNX_STT: {
@@ -590,6 +592,14 @@ export const templateActionNameMap = {
590
592
  },
591
593
  },
592
594
  GENERATOR_LLM: {
595
+ GENERATOR_LLM_TOKENIZE: {
596
+ mode: 'GENERATOR_LLM_MODE',
597
+ messages: 'GENERATOR_LLM_MESSAGES',
598
+ prompt: 'GENERATOR_LLM_PROMPT',
599
+ },
600
+ GENERATOR_LLM_DETOKENIZE: {
601
+ tokens: 'GENERATOR_LLM_TOKENS',
602
+ },
593
603
  GENERATOR_LLM_PROCESS_PROMPT: {
594
604
  sessionKey: 'GENERATOR_LLM_SESSION_KEY',
595
605
  mode: 'GENERATOR_LLM_MODE',
@@ -598,6 +608,7 @@ export const templateActionNameMap = {
598
608
  parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
599
609
  toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
600
610
  prompt: 'GENERATOR_LLM_PROMPT',
611
+ promptImagePaths: 'GENERATOR_LLM_PROMPT_IMAGE_PATHS',
601
612
  promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
602
613
  promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
603
614
  responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
@@ -610,6 +621,7 @@ export const templateActionNameMap = {
610
621
  parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
611
622
  toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
612
623
  prompt: 'GENERATOR_LLM_PROMPT',
624
+ promptImagePaths: 'GENERATOR_LLM_PROMPT_IMAGE_PATHS',
613
625
  promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
614
626
  promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
615
627
  responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
@@ -650,6 +662,7 @@ export const templateActionNameMap = {
650
662
  GENERATOR_QNN_LLM_GENERATE: {
651
663
  prompt: 'GENERATOR_QNN_LLM_PROMPT',
652
664
  messages: 'GENERATOR_QNN_LLM_MESSAGES',
665
+ tools: 'GENERATOR_QNN_LLM_TOOLS',
653
666
  },
654
667
  },
655
668
  GENERATOR_OPENAI_LLM: {
@@ -676,6 +689,7 @@ export const templateActionNameMap = {
676
689
  GENERATOR_ASSISTANT_ADD_MESSAGE: {
677
690
  role: 'GENERATOR_ASSISTANT_ROLE',
678
691
  content: 'GENERATOR_ASSISTANT_CONTENT',
692
+ image: 'GENERATOR_ASSISTANT_IMAGE',
679
693
  payload: 'GENERATOR_ASSISTANT_PAYLOAD',
680
694
  useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
681
695
  filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
@@ -699,12 +713,14 @@ export const templateActionNameMap = {
699
713
  GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX: {
700
714
  index: 'GENERATOR_ASSISTANT_INDEX',
701
715
  content: 'GENERATOR_ASSISTANT_CONTENT',
716
+ image: 'GENERATOR_ASSISTANT_IMAGE',
702
717
  payload: 'GENERATOR_ASSISTANT_PAYLOAD',
703
718
  },
704
719
  GENERATOR_ASSISTANT_ADD_AUDIO_MESSAGE: {
705
720
  role: 'GENERATOR_ASSISTANT_ROLE',
706
721
  contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
707
722
  contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
723
+ image: 'GENERATOR_ASSISTANT_IMAGE',
708
724
  useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
709
725
  payload: 'GENERATOR_ASSISTANT_PAYLOAD',
710
726
  filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
@@ -727,6 +743,7 @@ export const templateActionNameMap = {
727
743
  index: 'GENERATOR_ASSISTANT_INDEX',
728
744
  contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
729
745
  contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
746
+ image: 'GENERATOR_ASSISTANT_IMAGE',
730
747
  payload: 'GENERATOR_ASSISTANT_PAYLOAD',
731
748
  },
732
749
  GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.22.0-beta.10",
3
+ "version": "2.22.0-beta.12",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
@@ -14,5 +14,5 @@
14
14
  "lodash": "^4.17.4",
15
15
  "uuid": "^8.3.1"
16
16
  },
17
- "gitHead": "a66b1a510bfd78709dc6251ef5b83bc470049308"
17
+ "gitHead": "bf844dee8ddb0e8437c8795e0a44cafc48ef16d1"
18
18
  }
package/types/bricks.ts CHANGED
@@ -1870,7 +1870,7 @@ Default property:
1870
1870
  verticalMaxQuantity?: number | DataLink
1871
1871
  /* Resize mode */
1872
1872
  resizeMode?: 'auto' | 'fix' | DataLink
1873
- /* Align Content */
1873
+ /* Justify Content */
1874
1874
  justifyContent?: 'start' | 'end' | 'center' | 'space-between' | 'space-around' | DataLink
1875
1875
  /* Align Content */
1876
1876
  alignContent?:
@@ -47,7 +47,7 @@ Default property:
47
47
  completed?: Array<EventAction>
48
48
  }
49
49
  outlets?: {
50
- /* Result of each countdown change */
50
+ /* Countdown step value */
51
51
  countdown?: () => Data
52
52
  }
53
53
  }
@@ -691,7 +691,7 @@ Default property:
691
691
  }
692
692
  */
693
693
  property?: {
694
- /* Start query on generator initialized */
694
+ /* Start generator initialization execution immediately */
695
695
  init?: boolean | DataLink
696
696
  /* Data Bank Space ID */
697
697
  spacename?: string | DataLink
@@ -730,7 +730,7 @@ Default property:
730
730
  }
731
731
  }
732
732
 
733
- /* Fetch data & subscribe data change from Data Bank */
733
+ /* Get Data or subscribe to Data changes from Data Bank */
734
734
  export type GeneratorDataBank = Generator &
735
735
  GeneratorDataBankDef & {
736
736
  templateKey: 'GENERATOR_DATA_BANK'
@@ -752,7 +752,7 @@ export type GeneratorDataBank = Generator &
752
752
  >
753
753
  }
754
754
 
755
- /* Run GraphQL query with defined properties */
755
+ /* Execute GraphQL request with defined properties */
756
756
  export type GeneratorGraphQLActionRunQuery = ActionWithParams & {
757
757
  __actionName: 'GENERATOR_GRAPHQL_RUN_QUERY'
758
758
  params?: Array<
@@ -797,7 +797,7 @@ Default property:
797
797
  }
798
798
  */
799
799
  property?: {
800
- /* Start GraphQL query on generator initialized */
800
+ /* Start GraphQL request immediately after generator initialization */
801
801
  init?: boolean | DataLink
802
802
  /* GraphQL request type */
803
803
  type?: 'query' | 'mutation' | 'subscription' | DataLink
@@ -805,9 +805,9 @@ Default property:
805
805
  headers?: {} | DataLink
806
806
  /* HTTP request URL endpoint */
807
807
  endpoint?: string | DataLink
808
- /* Subscrpition endpoint */
808
+ /* Subscription endpoint */
809
809
  endpointForSubscription?: string | DataLink
810
- /* Subscrpition connection params */
810
+ /* Subscription connection params */
811
811
  connectionParams?: {} | DataLink
812
812
  /* Query content */
813
813
  query?: string | DataLink
@@ -831,9 +831,9 @@ Default property:
831
831
  firebaseMessagingSenderId?: string | DataLink
832
832
  }
833
833
  events?: {
834
- /* Event of subscription on connection */
834
+ /* Event triggered when subscription connection is successful */
835
835
  subscriptionOnConnection?: Array<EventAction>
836
- /* Server connections error of GraphQL subscription */
836
+ /* Event triggered when subscription connection error occurs */
837
837
  subscriptionOnConnectionError?: Array<EventAction>
838
838
  }
839
839
  outlets?: {
@@ -973,22 +973,22 @@ export type GeneratorHTTP = Generator &
973
973
  >
974
974
  }
975
975
 
976
- /* Start play sound */
976
+ /* Start playing sound */
977
977
  export type GeneratorSoundPlayerActionPlay = Action & {
978
978
  __actionName: 'GENERATOR_SOUND_PLAYER_PLAY'
979
979
  }
980
980
 
981
- /* Pause play sound */
981
+ /* Pause playing sound */
982
982
  export type GeneratorSoundPlayerActionPause = Action & {
983
983
  __actionName: 'GENERATOR_SOUND_PLAYER_PAUSE'
984
984
  }
985
985
 
986
- /* Resume play sound from pause */
986
+ /* Resume playing sound from pause */
987
987
  export type GeneratorSoundPlayerActionResume = Action & {
988
988
  __actionName: 'GENERATOR_SOUND_PLAYER_RESUME'
989
989
  }
990
990
 
991
- /* Stop play sound */
991
+ /* Stop playing sound */
992
992
  export type GeneratorSoundPlayerActionRelease = Action & {
993
993
  __actionName: 'GENERATOR_SOUND_PLAYER_RELEASE'
994
994
  }
@@ -1002,32 +1002,32 @@ Default property:
1002
1002
  }
1003
1003
  */
1004
1004
  property?: {
1005
- /* The sound file path */
1005
+ /* Sound file path */
1006
1006
  filePath?: string | DataLink
1007
- /* The checksum of file */
1007
+ /* MD5 */
1008
1008
  md5?: string | DataLink
1009
- /* Repeat the sound */
1009
+ /* Repeat playback */
1010
1010
  loop?: boolean | DataLink
1011
- /* The volume of sound (0 - 100) */
1011
+ /* Sound volume (0 - 100) */
1012
1012
  volume?: number | DataLink
1013
1013
  }
1014
1014
  events?: {
1015
- /* Event on sound file loaded */
1015
+ /* Sound file loaded successfully */
1016
1016
  onLoad?: Array<EventAction>
1017
- /* Event on load error */
1017
+ /* Sound file load error */
1018
1018
  onLoadError?: Array<EventAction>
1019
- /* Event on sound play */
1019
+ /* Sound playback complete */
1020
1020
  onPlay?: Array<EventAction>
1021
- /* Event on sound end */
1021
+ /* Sound file playback end */
1022
1022
  onEnd?: Array<EventAction>
1023
1023
  }
1024
1024
  outlets?: {
1025
- /* Is sound playing */
1025
+ /* Whether the sound is playing */
1026
1026
  isPlaying?: () => Data
1027
1027
  }
1028
1028
  }
1029
1029
 
1030
- /* Play sound file from file system, support sound format refer this https://developer.android.com/guide/topics/media/media-formats */
1030
+ /* Play sound, see supported formats at https://developer.android.com/guide/topics/media/media-formats */
1031
1031
  export type GeneratorSoundPlayer = Generator &
1032
1032
  GeneratorSoundPlayerDef & {
1033
1033
  templateKey: 'GENERATOR_SOUND_PLAYER'
@@ -1062,43 +1062,42 @@ Default property:
1062
1062
  }
1063
1063
  */
1064
1064
  property?: {
1065
- /* Enable listening */
1065
+ /* Enable listening for input */
1066
1066
  enabled?: boolean | DataLink
1067
- /* Key map to convert key or key code to specify content (e.g. { 37: 'left' }) */
1067
+ /* Key map to transform key or key code to the designated content (e.g. { 37: 'left' }) */
1068
1068
  keyMap?: {} | DataLink
1069
- /* Key outlet prefer use key code or key.
1070
- Please note that the key code is not supported on iOS / tvOS, so it will use `key` if value is `auto`. */
1069
+ /* Key outlet preference use key code or key. */
1071
1070
  keyOutletPrefer?: 'auto' | 'key-code' | 'key' | DataLink
1072
- /* Stop key or code to finish batch */
1071
+ /* Key or code to finish continuous input */
1073
1072
  batchStopKeys?: Array<string | DataLink | number | DataLink | DataLink> | DataLink
1074
- /* Debounce time to finish batch (ms) */
1073
+ /* Debounce time (ms) to finish continuous input */
1075
1074
  batchDebounce?: number | DataLink
1076
- /* Max wait time to finish batch (ms) (Default: No limit) */
1075
+ /* Maximum wait time (ms) to finish continuous input (default: unlimited) */
1077
1076
  batchDebounceMaxWait?: number | DataLink
1078
1077
  }
1079
1078
  events?: {
1080
- /* Event of key down */
1079
+ /* Event on key press */
1081
1080
  onDown?: Array<EventAction>
1082
- /* Event of key up */
1081
+ /* Event on key up */
1083
1082
  onUp?: Array<EventAction>
1084
- /* Event of batch input finished */
1083
+ /* Event on continuous input complete */
1085
1084
  onBatch?: Array<EventAction>
1086
1085
  }
1087
1086
  outlets?: {
1088
- /* Last key down code */
1087
+ /* Last key code pressed */
1089
1088
  lastKeyDown?: () => Data
1090
- /* Last key down flags */
1089
+ /* Modifier key information on last key press */
1091
1090
  lastKeyDownFlags?: () => Data
1092
- /* Last key up code */
1091
+ /* Last key code released */
1093
1092
  lastKeyUp?: () => Data
1094
- /* Last key up flags */
1093
+ /* Modifier key information on last key release */
1095
1094
  lastKeyUpFlags?: () => Data
1096
- /* Last batch events */
1095
+ /* Last continuous event */
1097
1096
  lastBatchEvents?: () => Data
1098
1097
  }
1099
1098
  }
1100
1099
 
1101
- /* Listening keyboard (controller) event */
1100
+ /* Access keyboard (remote control) events */
1102
1101
  export type GeneratorKeyboard = Generator &
1103
1102
  GeneratorKeyboardDef & {
1104
1103
  templateKey: 'GENERATOR_KEYBOARD'
@@ -1395,22 +1394,22 @@ export type GeneratorStep = Generator &
1395
1394
  >
1396
1395
  }
1397
1396
 
1398
- /* Start the next iterate */
1397
+ /* Proceed to next iteration */
1399
1398
  export type GeneratorIteratorActionNext = Action & {
1400
1399
  __actionName: 'GENERATOR_ITERATOR_NEXT'
1401
1400
  }
1402
1401
 
1403
- /* Back to the previous iterate */
1402
+ /* Go back to previous iteration */
1404
1403
  export type GeneratorIteratorActionPrevious = Action & {
1405
1404
  __actionName: 'GENERATOR_ITERATOR_PREVIOUS'
1406
1405
  }
1407
1406
 
1408
- /* Skip to last iterate element (Ignore loop) */
1407
+ /* Jump to the last iteration element (ignoring the loop setting) */
1409
1408
  export type GeneratorIteratorActionLast = Action & {
1410
1409
  __actionName: 'GENERATOR_ITERATOR_LAST'
1411
1410
  }
1412
1411
 
1413
- /* Reset the iterator state */
1412
+ /* Reset iteration state */
1414
1413
  export type GeneratorIteratorActionReset = Action & {
1415
1414
  __actionName: 'GENERATOR_ITERATOR_RESET'
1416
1415
  }
@@ -1425,40 +1424,40 @@ Default property:
1425
1424
  }
1426
1425
  */
1427
1426
  property?: {
1428
- /* The data source of the value. If it is an array, the value element is used. If it is an object, Object.values() is used as the data. If it is a string, the source character of the value is taken. If it is a number, it represents a count of 1N. */
1427
+ /* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.values() as data source. If it's a String, it will iterate through characters. If it's a Number, it represents count from 1 to N. */
1429
1428
  data?: any
1430
- /* Starting element index */
1429
+ /* Starting element position */
1431
1430
  start?: number | DataLink
1432
- /* Iterate step */
1431
+ /* Step size for each iteration */
1433
1432
  step?: number | DataLink
1434
- /* The maximum number of iterations (Set -1 for unlimited) */
1433
+ /* Maximum number of iterations (can be set to -1 for unlimited) */
1435
1434
  maxQuantity?: number | DataLink
1436
- /* Loop iterate */
1435
+ /* Whether to loop the iteration */
1437
1436
  loop?: boolean | DataLink
1438
1437
  }
1439
1438
  events?: {
1440
- /* Event on iterate */
1439
+ /* Event triggered on each iteration */
1441
1440
  iterate?: Array<EventAction>
1442
- /* Event on iterate round start */
1441
+ /* Event triggered on the first iteration of a round */
1443
1442
  first?: Array<EventAction>
1444
- /* Event on iterate round end */
1443
+ /* Event triggered on the last iteration of a round */
1445
1444
  end?: Array<EventAction>
1446
1445
  }
1447
1446
  outlets?: {
1448
- /* Elements that have been iterated (Included current iterated) */
1447
+ /* Elements that have been iterated (including current one) */
1449
1448
  iteratedArray?: () => Data
1450
- /* Elements not yet iterated */
1449
+ /* Elements that will be iterated but have not been iterated yet */
1451
1450
  upcomingArray?: () => Data
1452
- /* Current iterated element */
1451
+ /* Current iteration element */
1453
1452
  value?: () => Data
1454
- /* Current Key of iterated element (number: same as value; array, string: index; object: string) */
1453
+ /* Key of the current iteration element (for number: same as value, for array/string: index, for object: string key) */
1455
1454
  key?: () => Data
1456
- /* The current number of iterations (if data is 6 and step is 2, this value will be returned in order: 1, 2, 3) */
1455
+ /* Current iteration count (if data is 6 and step is 2, this will return: 1,2,3 in sequence) */
1457
1456
  index?: () => Data
1458
1457
  }
1459
1458
  }
1460
1459
 
1461
- /* Iterate values (Array, Object, Number, String) */
1460
+ /* Iterate through values (Array, Object, Number, String) */
1462
1461
  export type GeneratorIterator = Generator &
1463
1462
  GeneratorIteratorDef & {
1464
1463
  templateKey: 'GENERATOR_ITERATOR'
@@ -2065,14 +2064,11 @@ Default property:
2065
2064
  }
2066
2065
  */
2067
2066
  property?: {
2068
- /* Try attach on generator initialized
2069
- On web require user activation to attach device */
2067
+ /* Try attach on generator initialized On web require user activation to attach device */
2070
2068
  attachOnInit?: boolean | DataLink
2071
2069
  /* The serial device driver */
2072
2070
  driver?: 'fd' | 'usb' | DataLink
2073
- /* The serial device path
2074
- e.g. /dev/ttyS0 or /dev/bus/usb/001/001
2075
- For desktop and web is device index number */
2071
+ /* The serial device path e.g. /dev/ttyS0 or /dev/bus/usb/001/001 For desktop and web is device index number */
2076
2072
  path?: string | DataLink
2077
2073
  /* The serial USB vendor id (autoconnect first) */
2078
2074
  vendorId?: number | DataLink
@@ -4349,7 +4345,9 @@ Default property:
4349
4345
  `detect-data-change`: Watch data target change to return data,
4350
4346
  please update data with ({ id: string, content: string | object }),
4351
4347
  and ensure the id is same with request id
4352
- `script`: Not implemented yet */
4348
+ `script`: Run a JavaScript code to return data
4349
+ - Script can define members to call generator functions
4350
+ - Script support async/await */
4353
4351
  resources?:
4354
4352
  | Array<
4355
4353
  | DataLink
@@ -4365,7 +4363,7 @@ Default property:
4365
4363
  | {
4366
4364
  target?: string | DataLink
4367
4365
  timeout?: number | DataLink
4368
- payload?: any
4366
+ additionalParams?: {} | DataLink
4369
4367
  }
4370
4368
  scriptConfig?:
4371
4369
  | DataLink
@@ -4381,7 +4379,7 @@ Default property:
4381
4379
  }
4382
4380
  >
4383
4381
  | DataLink
4384
- payload?: any
4382
+ additionalParams?: {} | DataLink
4385
4383
  }
4386
4384
  }
4387
4385
  >
@@ -4391,7 +4389,9 @@ Default property:
4391
4389
  `detect-data-change`: Watch data target change to return data,
4392
4390
  please update data with ({ id: string, content: string | object }),
4393
4391
  and ensure the id is same with request id.
4394
- `script`: Not implemented yet */
4392
+ `script`: Run a JavaScript code to return data
4393
+ - Script can define members to call generator functions
4394
+ - Script support async/await */
4395
4395
  tools?:
4396
4396
  | Array<
4397
4397
  | DataLink
@@ -4406,7 +4406,7 @@ Default property:
4406
4406
  | {
4407
4407
  target?: string | DataLink
4408
4408
  timeout?: number | DataLink
4409
- payload?: any
4409
+ additionalParams?: {} | DataLink
4410
4410
  }
4411
4411
  scriptConfig?:
4412
4412
  | DataLink
@@ -4422,7 +4422,7 @@ Default property:
4422
4422
  }
4423
4423
  >
4424
4424
  | DataLink
4425
- payload?: any
4425
+ additionalParams?: {} | DataLink
4426
4426
  }
4427
4427
  }
4428
4428
  >
@@ -4433,7 +4433,9 @@ Default property:
4433
4433
  `detect-data-change`: Watch data target change to return data,
4434
4434
  please update data with ({ id: string, content: string | object }),
4435
4435
  and ensure the id is same with request id
4436
- `script`: Not implemented yet */
4436
+ `script`: Run a JavaScript code to return data
4437
+ - Script can define members to call generator functions
4438
+ - Script support async/await */
4437
4439
  prompts?:
4438
4440
  | Array<
4439
4441
  | DataLink
@@ -4449,7 +4451,7 @@ Default property:
4449
4451
  | {
4450
4452
  target?: string | DataLink
4451
4453
  timeout?: number | DataLink
4452
- payload?: any
4454
+ additionalParams?: {} | DataLink
4453
4455
  }
4454
4456
  scriptConfig?:
4455
4457
  | DataLink
@@ -4465,7 +4467,7 @@ Default property:
4465
4467
  }
4466
4468
  >
4467
4469
  | DataLink
4468
- payload?: any
4470
+ additionalParams?: {} | DataLink
4469
4471
  }
4470
4472
  }
4471
4473
  >
@@ -4998,6 +5000,16 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
4998
5000
  value?: Array<any> | DataLink | EventProperty
4999
5001
  mapping?: string
5000
5002
  }
5003
+ | {
5004
+ input: 'tools'
5005
+ value?: Array<any> | DataLink | EventProperty
5006
+ mapping?: string
5007
+ }
5008
+ | {
5009
+ input: 'toolChoice'
5010
+ value?: string | DataLink | EventProperty
5011
+ mapping?: string
5012
+ }
5001
5013
  >
5002
5014
  }
5003
5015
 
@@ -5017,6 +5029,8 @@ Default property:
5017
5029
  {
5018
5030
  "model": "BricksDisplay/phi-1_5-q4",
5019
5031
  "modelType": "auto",
5032
+ "toolCallParser": "llama3_json",
5033
+ "toolChoice": "auto",
5020
5034
  "maxNewTokens": 256,
5021
5035
  "temperature": 0.7,
5022
5036
  "topK": 50,
@@ -5123,6 +5137,14 @@ Default property:
5123
5137
  messages?: Array<DataLink | {}> | DataLink
5124
5138
  /* Images with message to inference */
5125
5139
  images?: Array<string | DataLink> | DataLink
5140
+ /* Tool call parser */
5141
+ toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
5142
+ /* Tools for chat mode using OpenAI-compatible function calling format
5143
+ Format: Array of objects with {type, function: {name, description, parameters}} structure
5144
+ See: https://platform.openai.com/docs/guides/function-calling */
5145
+ tools?: Array<{} | DataLink> | DataLink
5146
+ /* Tool choice for chat mode */
5147
+ toolChoice?: 'none' | 'auto' | DataLink
5126
5148
  /* Max new tokens to generate */
5127
5149
  maxNewTokens?: number | DataLink
5128
5150
  /* Temperature */
@@ -5157,6 +5179,10 @@ Default property:
5157
5179
  events?: {
5158
5180
  /* Event triggered when state change */
5159
5181
  onContextStateChange?: Array<EventAction>
5182
+ /* Event triggered on get function call request */
5183
+ onFunctionCall?: Array<EventAction>
5184
+ /* Event triggered on completion finished */
5185
+ onCompletionFinished?: Array<EventAction>
5160
5186
  /* Event triggered when error occurs */
5161
5187
  onError?: Array<EventAction>
5162
5188
  }
@@ -5167,6 +5193,8 @@ Default property:
5167
5193
  generated?: () => Data
5168
5194
  /* Full result of generation */
5169
5195
  fullResult?: () => Data
5196
+ /* Last function call */
5197
+ lastFunctionCall?: () => Data
5170
5198
  }
5171
5199
  }
5172
5200
 
@@ -5185,7 +5213,7 @@ export type GeneratorOnnxLLM = Generator &
5185
5213
  | SwitchCondData
5186
5214
  | {
5187
5215
  __typename: 'SwitchCondInnerStateOutlet'
5188
- outlet: 'contextState' | 'generated' | 'fullResult'
5216
+ outlet: 'contextState' | 'generated' | 'fullResult' | 'lastFunctionCall'
5189
5217
  value: any
5190
5218
  }
5191
5219
  }>
@@ -5876,6 +5904,43 @@ export type GeneratorLLMActionLoadModel = Action & {
5876
5904
  __actionName: 'GENERATOR_LLM_LOAD_MODEL'
5877
5905
  }
5878
5906
 
5907
+ /* Load multimodal (vision) model (PREVIEW FEATURE) */
5908
+ export type GeneratorLLMActionLoadMultimodalModel = Action & {
5909
+ __actionName: 'GENERATOR_LLM_LOAD_MULTIMODAL_MODEL'
5910
+ }
5911
+
5912
+ /* Tokenize the prompt */
5913
+ export type GeneratorLLMActionTokenize = ActionWithParams & {
5914
+ __actionName: 'GENERATOR_LLM_TOKENIZE'
5915
+ params?: Array<
5916
+ | {
5917
+ input: 'mode'
5918
+ value?: string | DataLink | EventProperty
5919
+ mapping?: string
5920
+ }
5921
+ | {
5922
+ input: 'messages'
5923
+ value?: Array<any> | DataLink | EventProperty
5924
+ mapping?: string
5925
+ }
5926
+ | {
5927
+ input: 'prompt'
5928
+ value?: string | DataLink | EventProperty
5929
+ mapping?: string
5930
+ }
5931
+ >
5932
+ }
5933
+
5934
+ /* Detokenize the tokens to text */
5935
+ export type GeneratorLLMActionDetokenize = ActionWithParams & {
5936
+ __actionName: 'GENERATOR_LLM_DETOKENIZE'
5937
+ params?: Array<{
5938
+ input: 'tokens'
5939
+ value?: Array<any> | DataLink | EventProperty
5940
+ mapping?: string
5941
+ }>
5942
+ }
5943
+
5879
5944
  /* Pre-process the prompt, this can speed up the completion action */
5880
5945
  export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
5881
5946
  __actionName: 'GENERATOR_LLM_PROCESS_PROMPT'
@@ -5915,6 +5980,11 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
5915
5980
  value?: string | DataLink | EventProperty
5916
5981
  mapping?: string
5917
5982
  }
5983
+ | {
5984
+ input: 'promptImagePaths'
5985
+ value?: Array<any> | DataLink | EventProperty
5986
+ mapping?: string
5987
+ }
5918
5988
  | {
5919
5989
  input: 'promptTemplateData'
5920
5990
  value?: {} | DataLink | EventProperty
@@ -5972,6 +6042,11 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
5972
6042
  value?: string | DataLink | EventProperty
5973
6043
  mapping?: string
5974
6044
  }
6045
+ | {
6046
+ input: 'promptImagePaths'
6047
+ value?: Array<any> | DataLink | EventProperty
6048
+ mapping?: string
6049
+ }
5975
6050
  | {
5976
6051
  input: 'promptTemplateData'
5977
6052
  value?: {} | DataLink | EventProperty
@@ -6152,6 +6227,11 @@ export type GeneratorLLMActionClearDownload = Action & {
6152
6227
  __actionName: 'GENERATOR_LLM_CLEAR_DOWNLOAD'
6153
6228
  }
6154
6229
 
6230
+ /* Release multimodal (vision) context (PREVIEW FEATURE) */
6231
+ export type GeneratorLLMActionReleaseMultimodalContext = Action & {
6232
+ __actionName: 'GENERATOR_LLM_RELEASE_MULTIMODAL_CONTEXT'
6233
+ }
6234
+
6155
6235
  /* Release context */
6156
6236
  export type GeneratorLLMActionReleaseContext = Action & {
6157
6237
  __actionName: 'GENERATOR_LLM_RELEASE_CONTEXT'
@@ -6174,7 +6254,7 @@ Default property:
6174
6254
  "cacheVType": "f16",
6175
6255
  "ctxShift": true,
6176
6256
  "transformScriptEnabled": false,
6177
- "transformScriptCode": "\/\* Global variable: inputs = { prompt, messages, variables } \*\/\nreturn inputs.prompt",
6257
+ "transformScriptCode": "\/\* Global variable: inputs = { prompt, messages, variables }, members = { llmUtils } \*\/\nreturn inputs.prompt",
6178
6258
  "transformScriptVariables": {},
6179
6259
  "sessionMinSaveSize": 50,
6180
6260
  "sessionRemain": 10,
@@ -6229,6 +6309,14 @@ Default property:
6229
6309
  modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
6230
6310
  /* Hash of model */
6231
6311
  modelHash?: string | DataLink
6312
+ /* Load multimodal (vision) context after model loaded (PREVIEW FEATURE) */
6313
+ initMultimodal?: boolean | DataLink
6314
+ /* The URL or path of mmproj file for multimodal vision support (PREVIEW FEATURE) */
6315
+ mmprojUrl?: string | DataLink
6316
+ /* Hash type of mmproj file (PREVIEW FEATURE) */
6317
+ mmprojHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
6318
+ /* Hash of mmproj file (PREVIEW FEATURE) */
6319
+ mmprojHash?: string | DataLink
6232
6320
  /* Chat Template (Jinja format) to override the default template from model */
6233
6321
  chatTemplate?: string | DataLink
6234
6322
  /* Context size (0 ~ 4096) (Default to 512) */
@@ -6298,6 +6386,9 @@ Default property:
6298
6386
  | DataLink
6299
6387
  /* Prompt (text mode) */
6300
6388
  completionPrompt?: string | DataLink
6389
+ /* Image paths to be used in the prompt template (PREVIEW FEATURE)
6390
+ In prompt, use `<__image__>` for position of image content */
6391
+ completionPromptImagePaths?: Array<string | DataLink> | DataLink
6301
6392
  /* Data to be used in the prompt template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */
6302
6393
  completionPromptTemplateData?: {} | DataLink
6303
6394
  /* The prompt template type */
@@ -6395,6 +6486,10 @@ Default property:
6395
6486
  sessions?: () => Data
6396
6487
  /* Is evaluating */
6397
6488
  isEvaluating?: () => Data
6489
+ /* Tokenize result */
6490
+ tokenizeResult?: () => Data
6491
+ /* Detokenize result */
6492
+ detokenizeResult?: () => Data
6398
6493
  /* Last formatted prompt (messages or prompt) */
6399
6494
  completionLastFormattedPrompt?: () => Data
6400
6495
  /* Last completion token */
@@ -6435,6 +6530,8 @@ export type GeneratorLLM = Generator &
6435
6530
  | 'contextDetails'
6436
6531
  | 'sessions'
6437
6532
  | 'isEvaluating'
6533
+ | 'tokenizeResult'
6534
+ | 'detokenizeResult'
6438
6535
  | 'completionLastFormattedPrompt'
6439
6536
  | 'completionLastToken'
6440
6537
  | 'completionResult'
@@ -6471,6 +6568,11 @@ export type GeneratorQnnLlmActionGenerate = ActionWithParams & {
6471
6568
  value?: Array<any> | DataLink | EventProperty
6472
6569
  mapping?: string
6473
6570
  }
6571
+ | {
6572
+ input: 'tools'
6573
+ value?: Array<any> | DataLink | EventProperty
6574
+ mapping?: string
6575
+ }
6474
6576
  >
6475
6577
  }
6476
6578
 
@@ -6490,6 +6592,7 @@ Default property:
6490
6592
  {
6491
6593
  "modelType": "Llama 3.2 3B Chat",
6492
6594
  "chatFormat": "Llama 3.x",
6595
+ "toolsInUserMessage": true,
6493
6596
  "toolCallParser": "llama3_json",
6494
6597
  "toolChoice": "auto",
6495
6598
  "parallelToolCalls": false,
@@ -6518,9 +6621,18 @@ Default property:
6518
6621
  /* Custom model split parts */
6519
6622
  customModelSplitParts?: number | DataLink
6520
6623
  /* Chat format */
6521
- chatFormat?: 'Llama 2' | 'Llama 3' | 'Llama 3.x' | 'Mistral v0.3' | 'Qwen 2' | DataLink
6624
+ chatFormat?:
6625
+ | 'Llama 2'
6626
+ | 'Llama 3'
6627
+ | 'Llama 3.x'
6628
+ | 'Mistral v0.3'
6629
+ | 'Qwen 2'
6630
+ | 'Custom'
6631
+ | DataLink
6522
6632
  /* Custom chat format template */
6523
6633
  customChatFormat?: string | DataLink
6634
+ /* Put tools in user message */
6635
+ toolsInUserMessage?: boolean | DataLink
6524
6636
  /* Prompt to generate */
6525
6637
  prompt?: string | DataLink
6526
6638
  /* Chat messages */
@@ -6536,7 +6648,7 @@ Default property:
6536
6648
  /* Stop words */
6537
6649
  stopWords?: Array<string | DataLink> | DataLink
6538
6650
  /* Tool call parser */
6539
- toolCallParser?: 'llama3_json' | 'mistral' | DataLink
6651
+ toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
6540
6652
  /* Tools for chat mode using OpenAI-compatible function calling format
6541
6653
  Format: Array of objects with {type, function: {name, description, parameters}} structure
6542
6654
  See: https://platform.openai.com/docs/guides/function-calling */
@@ -6915,6 +7027,11 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
6915
7027
  value?: string | DataLink | EventProperty
6916
7028
  mapping?: string
6917
7029
  }
7030
+ | {
7031
+ input: 'image'
7032
+ value?: string | DataLink | EventProperty
7033
+ mapping?: string
7034
+ }
6918
7035
  | {
6919
7036
  input: 'payload'
6920
7037
  value?: {} | DataLink | EventProperty
@@ -7021,6 +7138,11 @@ export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
7021
7138
  value?: string | DataLink | EventProperty
7022
7139
  mapping?: string
7023
7140
  }
7141
+ | {
7142
+ input: 'image'
7143
+ value?: string | DataLink | EventProperty
7144
+ mapping?: string
7145
+ }
7024
7146
  | {
7025
7147
  input: 'payload'
7026
7148
  value?: {} | DataLink | EventProperty
@@ -7048,6 +7170,11 @@ export type GeneratorAssistantActionAddAudioMessage = ActionWithParams & {
7048
7170
  value?: string | DataLink | EventProperty
7049
7171
  mapping?: string
7050
7172
  }
7173
+ | {
7174
+ input: 'image'
7175
+ value?: string | DataLink | EventProperty
7176
+ mapping?: string
7177
+ }
7051
7178
  | {
7052
7179
  input: 'useFileSearch'
7053
7180
  value?: boolean | DataLink | EventProperty
@@ -7147,6 +7274,11 @@ export type GeneratorAssistantActionUpdateAudioMessageAtIndex = ActionWithParams
7147
7274
  value?: string | DataLink | EventProperty
7148
7275
  mapping?: string
7149
7276
  }
7277
+ | {
7278
+ input: 'image'
7279
+ value?: string | DataLink | EventProperty
7280
+ mapping?: string
7281
+ }
7150
7282
  | {
7151
7283
  input: 'payload'
7152
7284
  value?: {} | DataLink | EventProperty
@@ -7303,7 +7435,9 @@ Default property:
7303
7435
  cacheMessages?: boolean | DataLink
7304
7436
  /* LLM Generator (Supports `LLM (GGML)` and `OpenAI LLM` generators) */
7305
7437
  llmGeneratorId?: string | DataLink
7306
- /* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use. */
7438
+ /* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use.
7439
+
7440
+ Note: LLM (Qualcomm AI Engine) recommend use `manual` and loaded constantly. */
7307
7441
  llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
7308
7442
  /* LLM main session key */
7309
7443
  llmSessionKey?: string | DataLink
@@ -724,6 +724,16 @@ export const templateEventPropsMap = {
724
724
  onContextStateChange: [
725
725
  'GENERATOR_ONNX_LLM_CONTEXT_STATE', // type: string
726
726
  ],
727
+ onFunctionCall: [
728
+ 'GENERATOR_ONNX_LLM_FUNCTION_CALL_NAME', // type: string
729
+ 'GENERATOR_ONNX_LLM_FUNCTION_CALL_ARGUMENTS', // type: object
730
+ 'GENERATOR_ONNX_LLM_FUNCTION_CALL_DETAILS', // type: object
731
+ ],
732
+ onCompletionFinished: [
733
+ 'GENERATOR_ONNX_LLM_COMPLETION_RESULT', // type: string
734
+ 'GENERATOR_ONNX_LLM_COMPLETION_TOOL_CALLS', // type: array
735
+ 'GENERATOR_ONNX_LLM_COMPLETION_FULL_CONTEXT', // type: string
736
+ ],
727
737
  onError: [
728
738
  'GENERATOR_ONNX_LLM_ERROR', // type: string
729
739
  ],
@@ -788,6 +798,7 @@ export const templateEventPropsMap = {
788
798
  onGenerate: [
789
799
  'GENERATOR_QNN_LLM_RESULT', // type: string
790
800
  'GENERATOR_QNN_LLM_FULL_CONTEXT', // type: string
801
+ 'GENERATOR_QNN_LLM_TOOL_CALLS', // type: array
791
802
  ],
792
803
  onFunctionCall: [
793
804
  'GENERATOR_QNN_LLM_FUNCTION_CALL_NAME', // type: string