@fugood/bricks-project 2.22.0-beta.11 → 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.11",
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": "a6ee3595eab6b78d68c51effdeac7224e666134c"
17
+ "gitHead": "bf844dee8ddb0e8437c8795e0a44cafc48ef16d1"
18
18
  }
@@ -5000,6 +5000,16 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
5000
5000
  value?: Array<any> | DataLink | EventProperty
5001
5001
  mapping?: string
5002
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
+ }
5003
5013
  >
5004
5014
  }
5005
5015
 
@@ -5019,6 +5029,8 @@ Default property:
5019
5029
  {
5020
5030
  "model": "BricksDisplay/phi-1_5-q4",
5021
5031
  "modelType": "auto",
5032
+ "toolCallParser": "llama3_json",
5033
+ "toolChoice": "auto",
5022
5034
  "maxNewTokens": 256,
5023
5035
  "temperature": 0.7,
5024
5036
  "topK": 50,
@@ -5125,6 +5137,14 @@ Default property:
5125
5137
  messages?: Array<DataLink | {}> | DataLink
5126
5138
  /* Images with message to inference */
5127
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
5128
5148
  /* Max new tokens to generate */
5129
5149
  maxNewTokens?: number | DataLink
5130
5150
  /* Temperature */
@@ -5159,6 +5179,10 @@ Default property:
5159
5179
  events?: {
5160
5180
  /* Event triggered when state change */
5161
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>
5162
5186
  /* Event triggered when error occurs */
5163
5187
  onError?: Array<EventAction>
5164
5188
  }
@@ -5169,6 +5193,8 @@ Default property:
5169
5193
  generated?: () => Data
5170
5194
  /* Full result of generation */
5171
5195
  fullResult?: () => Data
5196
+ /* Last function call */
5197
+ lastFunctionCall?: () => Data
5172
5198
  }
5173
5199
  }
5174
5200
 
@@ -5187,7 +5213,7 @@ export type GeneratorOnnxLLM = Generator &
5187
5213
  | SwitchCondData
5188
5214
  | {
5189
5215
  __typename: 'SwitchCondInnerStateOutlet'
5190
- outlet: 'contextState' | 'generated' | 'fullResult'
5216
+ outlet: 'contextState' | 'generated' | 'fullResult' | 'lastFunctionCall'
5191
5217
  value: any
5192
5218
  }
5193
5219
  }>
@@ -5878,6 +5904,43 @@ export type GeneratorLLMActionLoadModel = Action & {
5878
5904
  __actionName: 'GENERATOR_LLM_LOAD_MODEL'
5879
5905
  }
5880
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
+
5881
5944
  /* Pre-process the prompt, this can speed up the completion action */
5882
5945
  export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
5883
5946
  __actionName: 'GENERATOR_LLM_PROCESS_PROMPT'
@@ -5917,6 +5980,11 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
5917
5980
  value?: string | DataLink | EventProperty
5918
5981
  mapping?: string
5919
5982
  }
5983
+ | {
5984
+ input: 'promptImagePaths'
5985
+ value?: Array<any> | DataLink | EventProperty
5986
+ mapping?: string
5987
+ }
5920
5988
  | {
5921
5989
  input: 'promptTemplateData'
5922
5990
  value?: {} | DataLink | EventProperty
@@ -5974,6 +6042,11 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
5974
6042
  value?: string | DataLink | EventProperty
5975
6043
  mapping?: string
5976
6044
  }
6045
+ | {
6046
+ input: 'promptImagePaths'
6047
+ value?: Array<any> | DataLink | EventProperty
6048
+ mapping?: string
6049
+ }
5977
6050
  | {
5978
6051
  input: 'promptTemplateData'
5979
6052
  value?: {} | DataLink | EventProperty
@@ -6154,6 +6227,11 @@ export type GeneratorLLMActionClearDownload = Action & {
6154
6227
  __actionName: 'GENERATOR_LLM_CLEAR_DOWNLOAD'
6155
6228
  }
6156
6229
 
6230
+ /* Release multimodal (vision) context (PREVIEW FEATURE) */
6231
+ export type GeneratorLLMActionReleaseMultimodalContext = Action & {
6232
+ __actionName: 'GENERATOR_LLM_RELEASE_MULTIMODAL_CONTEXT'
6233
+ }
6234
+
6157
6235
  /* Release context */
6158
6236
  export type GeneratorLLMActionReleaseContext = Action & {
6159
6237
  __actionName: 'GENERATOR_LLM_RELEASE_CONTEXT'
@@ -6231,6 +6309,14 @@ Default property:
6231
6309
  modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
6232
6310
  /* Hash of model */
6233
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
6234
6320
  /* Chat Template (Jinja format) to override the default template from model */
6235
6321
  chatTemplate?: string | DataLink
6236
6322
  /* Context size (0 ~ 4096) (Default to 512) */
@@ -6300,6 +6386,9 @@ Default property:
6300
6386
  | DataLink
6301
6387
  /* Prompt (text mode) */
6302
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
6303
6392
  /* Data to be used in the prompt template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */
6304
6393
  completionPromptTemplateData?: {} | DataLink
6305
6394
  /* The prompt template type */
@@ -6397,6 +6486,10 @@ Default property:
6397
6486
  sessions?: () => Data
6398
6487
  /* Is evaluating */
6399
6488
  isEvaluating?: () => Data
6489
+ /* Tokenize result */
6490
+ tokenizeResult?: () => Data
6491
+ /* Detokenize result */
6492
+ detokenizeResult?: () => Data
6400
6493
  /* Last formatted prompt (messages or prompt) */
6401
6494
  completionLastFormattedPrompt?: () => Data
6402
6495
  /* Last completion token */
@@ -6437,6 +6530,8 @@ export type GeneratorLLM = Generator &
6437
6530
  | 'contextDetails'
6438
6531
  | 'sessions'
6439
6532
  | 'isEvaluating'
6533
+ | 'tokenizeResult'
6534
+ | 'detokenizeResult'
6440
6535
  | 'completionLastFormattedPrompt'
6441
6536
  | 'completionLastToken'
6442
6537
  | 'completionResult'
@@ -6473,6 +6568,11 @@ export type GeneratorQnnLlmActionGenerate = ActionWithParams & {
6473
6568
  value?: Array<any> | DataLink | EventProperty
6474
6569
  mapping?: string
6475
6570
  }
6571
+ | {
6572
+ input: 'tools'
6573
+ value?: Array<any> | DataLink | EventProperty
6574
+ mapping?: string
6575
+ }
6476
6576
  >
6477
6577
  }
6478
6578
 
@@ -6492,6 +6592,7 @@ Default property:
6492
6592
  {
6493
6593
  "modelType": "Llama 3.2 3B Chat",
6494
6594
  "chatFormat": "Llama 3.x",
6595
+ "toolsInUserMessage": true,
6495
6596
  "toolCallParser": "llama3_json",
6496
6597
  "toolChoice": "auto",
6497
6598
  "parallelToolCalls": false,
@@ -6520,9 +6621,18 @@ Default property:
6520
6621
  /* Custom model split parts */
6521
6622
  customModelSplitParts?: number | DataLink
6522
6623
  /* Chat format */
6523
- 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
6524
6632
  /* Custom chat format template */
6525
6633
  customChatFormat?: string | DataLink
6634
+ /* Put tools in user message */
6635
+ toolsInUserMessage?: boolean | DataLink
6526
6636
  /* Prompt to generate */
6527
6637
  prompt?: string | DataLink
6528
6638
  /* Chat messages */
@@ -6538,7 +6648,7 @@ Default property:
6538
6648
  /* Stop words */
6539
6649
  stopWords?: Array<string | DataLink> | DataLink
6540
6650
  /* Tool call parser */
6541
- toolCallParser?: 'llama3_json' | 'mistral' | DataLink
6651
+ toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
6542
6652
  /* Tools for chat mode using OpenAI-compatible function calling format
6543
6653
  Format: Array of objects with {type, function: {name, description, parameters}} structure
6544
6654
  See: https://platform.openai.com/docs/guides/function-calling */
@@ -6917,6 +7027,11 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
6917
7027
  value?: string | DataLink | EventProperty
6918
7028
  mapping?: string
6919
7029
  }
7030
+ | {
7031
+ input: 'image'
7032
+ value?: string | DataLink | EventProperty
7033
+ mapping?: string
7034
+ }
6920
7035
  | {
6921
7036
  input: 'payload'
6922
7037
  value?: {} | DataLink | EventProperty
@@ -7023,6 +7138,11 @@ export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
7023
7138
  value?: string | DataLink | EventProperty
7024
7139
  mapping?: string
7025
7140
  }
7141
+ | {
7142
+ input: 'image'
7143
+ value?: string | DataLink | EventProperty
7144
+ mapping?: string
7145
+ }
7026
7146
  | {
7027
7147
  input: 'payload'
7028
7148
  value?: {} | DataLink | EventProperty
@@ -7050,6 +7170,11 @@ export type GeneratorAssistantActionAddAudioMessage = ActionWithParams & {
7050
7170
  value?: string | DataLink | EventProperty
7051
7171
  mapping?: string
7052
7172
  }
7173
+ | {
7174
+ input: 'image'
7175
+ value?: string | DataLink | EventProperty
7176
+ mapping?: string
7177
+ }
7053
7178
  | {
7054
7179
  input: 'useFileSearch'
7055
7180
  value?: boolean | DataLink | EventProperty
@@ -7149,6 +7274,11 @@ export type GeneratorAssistantActionUpdateAudioMessageAtIndex = ActionWithParams
7149
7274
  value?: string | DataLink | EventProperty
7150
7275
  mapping?: string
7151
7276
  }
7277
+ | {
7278
+ input: 'image'
7279
+ value?: string | DataLink | EventProperty
7280
+ mapping?: string
7281
+ }
7152
7282
  | {
7153
7283
  input: 'payload'
7154
7284
  value?: {} | DataLink | EventProperty
@@ -7305,7 +7435,9 @@ Default property:
7305
7435
  cacheMessages?: boolean | DataLink
7306
7436
  /* LLM Generator (Supports `LLM (GGML)` and `OpenAI LLM` generators) */
7307
7437
  llmGeneratorId?: string | DataLink
7308
- /* 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. */
7309
7441
  llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
7310
7442
  /* LLM main session key */
7311
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