@fugood/bricks-project 2.21.0-beta.32 → 2.21.0-beta.34

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.
@@ -466,6 +466,18 @@ export const templateActionNameMap = {
466
466
  rawCommands: 'GENERATOR_THERMAL_PRINTER_RAW_COMMANDS',
467
467
  },
468
468
  },
469
+ GENERATOR_SQLITE: {
470
+ GENERATOR_SQLITE_EXECUTE: {
471
+ sql: 'GENERATOR_SQLITE_SQL',
472
+ params: 'GENERATOR_SQLITE_PARAMS',
473
+ paramsString: 'GENERATOR_SQLITE_PARAMS_STRING',
474
+ },
475
+ GENERATOR_SQLITE_QUERY: {
476
+ sql: 'GENERATOR_SQLITE_SQL',
477
+ params: 'GENERATOR_SQLITE_PARAMS',
478
+ paramsString: 'GENERATOR_SQLITE_PARAMS_STRING',
479
+ },
480
+ },
469
481
  GENERATOR_TTS: {
470
482
  GENERATOR_TTS_GENERATE: {
471
483
  text: 'GENERATOR_TTS_TEXT',
@@ -517,17 +529,25 @@ export const templateActionNameMap = {
517
529
  sessionKey: 'GENERATOR_LLM_SESSION_KEY',
518
530
  mode: 'GENERATOR_LLM_MODE',
519
531
  messages: 'GENERATOR_LLM_MESSAGES',
532
+ tools: 'GENERATOR_LLM_TOOLS',
533
+ parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
534
+ toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
520
535
  prompt: 'GENERATOR_LLM_PROMPT',
521
536
  promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
522
537
  promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
538
+ responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
523
539
  },
524
540
  GENERATOR_LLM_COMPLETION: {
525
541
  sessionKey: 'GENERATOR_LLM_SESSION_KEY',
526
542
  mode: 'GENERATOR_LLM_MODE',
527
543
  messages: 'GENERATOR_LLM_MESSAGES',
544
+ tools: 'GENERATOR_LLM_TOOLS',
545
+ parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
546
+ toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
528
547
  prompt: 'GENERATOR_LLM_PROMPT',
529
548
  promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
530
549
  promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
550
+ responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
531
551
  grammar: 'GENERATOR_LLM_GRAMMAR',
532
552
  stopWords: 'GENERATOR_LLM_STOP_WORDS',
533
553
  predict: 'GENERATOR_LLM_PREDICT',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.21.0-beta.32",
3
+ "version": "2.21.0-beta.34",
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": "47ddd77695dc02c25ec8d79617f55fc2194e16d3"
16
+ "gitHead": "8a64292b4f84242e10cde574f33c88ceefc7754e"
17
17
  }
package/types/bricks.ts CHANGED
@@ -3497,7 +3497,8 @@ Default property:
3497
3497
  "enableCache": true,
3498
3498
  "type": "image",
3499
3499
  "resizeMode": "cover",
3500
- "provider": "openai"
3500
+ "provider": "openai",
3501
+ "freepikClassicImageSize": "square_1_1"
3501
3502
  }
3502
3503
  */
3503
3504
  property?: BrickBasicProperty & {
@@ -3523,16 +3524,100 @@ Default property:
3523
3524
  openaiStyle?: 'vivid' | 'natural' | DataLink
3524
3525
  /* OpenAI image quality (standard or hd) */
3525
3526
  openaiQuality?: 'standard' | 'hd' | DataLink
3526
- /* Freepik image style */
3527
- freepikClassicStyle?: string | DataLink
3528
3527
  /* Freepik image size */
3529
- freepikClassicSize?: 'square' | 'portrait' | 'landscape' | DataLink
3528
+ freepikClassicImageSize?:
3529
+ | 'square_1_1'
3530
+ | 'classic_4_3'
3531
+ | 'traditional_3_4'
3532
+ | 'widescreen_16_9'
3533
+ | 'social_story_9_16'
3534
+ | 'smartphone_horizontal_20_9'
3535
+ | 'smartphone_vertical_9_20'
3536
+ | 'standard_3_2'
3537
+ | 'portrait_2_3'
3538
+ | 'horizontal_2_1'
3539
+ | 'vertical_1_2'
3540
+ | 'social_5_4'
3541
+ | 'social_post_4_5'
3542
+ | DataLink
3543
+ /* Freepik image style */
3544
+ freepikClassicStyle?:
3545
+ | 'photo'
3546
+ | 'digital-art'
3547
+ | '3d'
3548
+ | 'painting'
3549
+ | 'low-poly'
3550
+ | 'pixel-art'
3551
+ | 'anime'
3552
+ | 'cyberpunk'
3553
+ | 'comic'
3554
+ | 'vintage'
3555
+ | 'cartoon'
3556
+ | 'vector'
3557
+ | 'studio-shot'
3558
+ | 'dark'
3559
+ | 'sketch'
3560
+ | 'mockup'
3561
+ | '2000s-pone'
3562
+ | '70s-vibe'
3563
+ | 'watercolor'
3564
+ | 'art-nouveau'
3565
+ | 'origami'
3566
+ | 'surreal'
3567
+ | 'fantasy'
3568
+ | 'traditional-japan'
3569
+ | DataLink
3530
3570
  /* Freepik color scheme */
3531
- freepikClassicColor?: string | DataLink
3571
+ freepikClassicStyleColor?:
3572
+ | 'b&w'
3573
+ | 'pastel'
3574
+ | 'sepia'
3575
+ | 'dramatic'
3576
+ | 'vibrant'
3577
+ | 'orange&teal'
3578
+ | 'film-filter'
3579
+ | 'split'
3580
+ | 'electric'
3581
+ | 'pastel-pink'
3582
+ | 'gold-glow'
3583
+ | 'autumn'
3584
+ | 'muted-green'
3585
+ | 'deep-teal'
3586
+ | 'duotone'
3587
+ | 'terracotta&teal'
3588
+ | 'red&blue'
3589
+ | 'cold-neon'
3590
+ | 'burgundy&blue'
3591
+ | DataLink
3532
3592
  /* Freepik lighting style */
3533
- freepikClassicLighting?: string | DataLink
3593
+ freepikClassicStyleLighting?:
3594
+ | 'studio'
3595
+ | 'warm'
3596
+ | 'cinematic'
3597
+ | 'volumetric'
3598
+ | 'golden-hour'
3599
+ | 'long-exposure'
3600
+ | 'cold'
3601
+ | 'iridescent'
3602
+ | 'dramatic'
3603
+ | 'hardlight'
3604
+ | 'redscale'
3605
+ | 'indoor-light'
3606
+ | DataLink
3534
3607
  /* Freepik framing style */
3535
- freepikClassicFraming?: string | DataLink
3608
+ freepikClassicStyleFraming?:
3609
+ | 'portrait'
3610
+ | 'macro'
3611
+ | 'panoramic'
3612
+ | 'aerial-view'
3613
+ | 'close-up'
3614
+ | 'cinematic'
3615
+ | 'high-angle'
3616
+ | 'low-angle'
3617
+ | 'symmetry'
3618
+ | 'fish-eye'
3619
+ | 'first-person'
3620
+ | DataLink
3536
3621
  /* Freepik guidance scale (level of fidelity to prompt) */
3537
3622
  freepikClassicGuidanceScale?: number | DataLink
3538
3623
  /* Freepik negative prompt (attributes to avoid) */
@@ -4835,6 +4835,132 @@ export type GeneratorThermalPrinter = Generator &
4835
4835
  >
4836
4836
  }
4837
4837
 
4838
+ /* Execute SQL statement */
4839
+ export type GeneratorSqliteActionExecute = ActionWithParams & {
4840
+ __actionName: 'GENERATOR_SQLITE_EXECUTE'
4841
+ params?: Array<
4842
+ | {
4843
+ input: 'sql'
4844
+ value?: string | DataLink
4845
+ mapping?: string
4846
+ }
4847
+ | {
4848
+ input: 'params'
4849
+ value?: Array<any> | DataLink
4850
+ mapping?: string
4851
+ }
4852
+ | {
4853
+ input: 'paramsString'
4854
+ value?: string | DataLink
4855
+ mapping?: string
4856
+ }
4857
+ >
4858
+ }
4859
+
4860
+ /* Query data from database */
4861
+ export type GeneratorSqliteActionQuery = ActionWithParams & {
4862
+ __actionName: 'GENERATOR_SQLITE_QUERY'
4863
+ params?: Array<
4864
+ | {
4865
+ input: 'sql'
4866
+ value?: string | DataLink
4867
+ mapping?: string
4868
+ }
4869
+ | {
4870
+ input: 'params'
4871
+ value?: Array<any> | DataLink
4872
+ mapping?: string
4873
+ }
4874
+ | {
4875
+ input: 'paramsString'
4876
+ value?: string | DataLink
4877
+ mapping?: string
4878
+ }
4879
+ >
4880
+ }
4881
+
4882
+ interface GeneratorSqliteDef {
4883
+ /*
4884
+ Default property:
4885
+ {
4886
+ "init": false,
4887
+ "dbName": "default",
4888
+ "storageType": "file",
4889
+ "useFile": false
4890
+ }
4891
+ */
4892
+ property?: {
4893
+ /* Initialize database on subspace mounted */
4894
+ init?: boolean | DataLink
4895
+ /* Database name */
4896
+ dbName?: string | DataLink
4897
+ /* Storage type */
4898
+ storageType?: 'file' | 'memory' | DataLink
4899
+ /* Use specific file (memory type will be ignored) */
4900
+ useFile?: boolean | DataLink
4901
+ /* File URI for SQLite database */
4902
+ fileUri?: string | DataLink
4903
+ /* MD5 hash of file URI */
4904
+ fileUriMd5?: string | DataLink
4905
+ }
4906
+ events?: {
4907
+ /* Event triggered when error occurs */
4908
+ onError?: Array<
4909
+ EventAction & {
4910
+ eventPropertyMapping?: {
4911
+ error: {
4912
+ type: 'string'
4913
+ path: string
4914
+ }
4915
+ }
4916
+ }
4917
+ >
4918
+ /* Event triggered when query result is ready */
4919
+ onQueryResult?: Array<
4920
+ EventAction & {
4921
+ eventPropertyMapping?: {
4922
+ queryResult: {
4923
+ type: 'array'
4924
+ path: string
4925
+ }
4926
+ }
4927
+ }
4928
+ >
4929
+ }
4930
+ outlets?: {
4931
+ /* Whether the database is ready */
4932
+ isReady?: () => Data
4933
+ /* Database path */
4934
+ dbPath?: () => Data
4935
+ /* Error message */
4936
+ error?: () => Data
4937
+ /* Last query result */
4938
+ lastResult?: () => Data
4939
+ }
4940
+ }
4941
+
4942
+ /* SQLite - General database operations */
4943
+ export type GeneratorSqlite = Generator &
4944
+ GeneratorSqliteDef & {
4945
+ templateKey: 'GENERATOR_SQLITE'
4946
+ switches: Array<
4947
+ SwitchDef &
4948
+ GeneratorSqliteDef & {
4949
+ conds?: Array<{
4950
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
4951
+ cond:
4952
+ | SwitchCondInnerStateCurrentCanvas
4953
+ | SwitchCondData
4954
+ | {
4955
+ __typename: 'SwitchCondInnerStateOutlet'
4956
+ outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult'
4957
+ value: any
4958
+ }
4959
+ }>
4960
+ }
4961
+ >
4962
+ }
4963
+
4838
4964
  /* Load the model */
4839
4965
  export type GeneratorTTSActionLoadModel = Action & {
4840
4966
  __actionName: 'GENERATOR_TTS_LOAD_MODEL'
@@ -4972,6 +5098,8 @@ Default property:
4972
5098
  contextState?: () => Data
4973
5099
  /* Generated audio file */
4974
5100
  generatedAudio?: () => Data
5101
+ /* Generated audio file is playing */
5102
+ generatedAudioPlaying?: () => Data
4975
5103
  }
4976
5104
  }
4977
5105
 
@@ -4990,7 +5118,7 @@ export type GeneratorTTS = Generator &
4990
5118
  | SwitchCondData
4991
5119
  | {
4992
5120
  __typename: 'SwitchCondInnerStateOutlet'
4993
- outlet: 'contextState' | 'generatedAudio'
5121
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
4994
5122
  value: any
4995
5123
  }
4996
5124
  }>
@@ -5960,6 +6088,21 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
5960
6088
  value?: Array<any> | DataLink
5961
6089
  mapping?: string
5962
6090
  }
6091
+ | {
6092
+ input: 'tools'
6093
+ value?: Array<any> | DataLink
6094
+ mapping?: string
6095
+ }
6096
+ | {
6097
+ input: 'parallelToolCalls'
6098
+ value?: boolean | DataLink
6099
+ mapping?: string
6100
+ }
6101
+ | {
6102
+ input: 'toolChoice'
6103
+ value?: string | DataLink
6104
+ mapping?: string
6105
+ }
5963
6106
  | {
5964
6107
  input: 'prompt'
5965
6108
  value?: string | DataLink
@@ -5975,6 +6118,11 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
5975
6118
  value?: string | DataLink
5976
6119
  mapping?: string
5977
6120
  }
6121
+ | {
6122
+ input: 'responseFormat'
6123
+ value?: {} | DataLink
6124
+ mapping?: string
6125
+ }
5978
6126
  >
5979
6127
  }
5980
6128
 
@@ -5997,6 +6145,21 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
5997
6145
  value?: Array<any> | DataLink
5998
6146
  mapping?: string
5999
6147
  }
6148
+ | {
6149
+ input: 'tools'
6150
+ value?: Array<any> | DataLink
6151
+ mapping?: string
6152
+ }
6153
+ | {
6154
+ input: 'parallelToolCalls'
6155
+ value?: boolean | DataLink
6156
+ mapping?: string
6157
+ }
6158
+ | {
6159
+ input: 'toolChoice'
6160
+ value?: string | DataLink
6161
+ mapping?: string
6162
+ }
6000
6163
  | {
6001
6164
  input: 'prompt'
6002
6165
  value?: string | DataLink
@@ -6012,6 +6175,11 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
6012
6175
  value?: string | DataLink
6013
6176
  mapping?: string
6014
6177
  }
6178
+ | {
6179
+ input: 'responseFormat'
6180
+ value?: {} | DataLink
6181
+ mapping?: string
6182
+ }
6015
6183
  | {
6016
6184
  input: 'grammar'
6017
6185
  value?: string | DataLink
@@ -6253,6 +6421,8 @@ Default property:
6253
6421
  modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
6254
6422
  /* Hash of model */
6255
6423
  modelHash?: string | DataLink
6424
+ /* Chat Template (Jinja format) to override the default template from model */
6425
+ chatTemplate?: string | DataLink
6256
6426
  /* Context size (0 ~ 4096) (Default to 512) */
6257
6427
  contextSize?: number | DataLink
6258
6428
  /* Logical batch size for prompt processing */
@@ -6263,8 +6433,9 @@ Default property:
6263
6433
  maxThreads?: number | DataLink
6264
6434
  /* Accelerator variant (Only for desktop)
6265
6435
  `default` - CPU / Metal (macOS)
6266
- `vulkan` - Use Vulkan */
6267
- accelVariant?: 'default' | 'vulkan' | DataLink
6436
+ `vulkan` - Use Vulkan
6437
+ `cuda` - Use CUDA */
6438
+ accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
6268
6439
  /* Main GPU index */
6269
6440
  mainGpu?: number | DataLink
6270
6441
  /* Number of GPU layers (NOTE: Currently not supported for Android) */
@@ -6285,10 +6456,6 @@ Default property:
6285
6456
  transformScriptCode?: string | DataLink
6286
6457
  /* Variables used in Transform Script (object) */
6287
6458
  transformScriptVariables?: {} | DataLink
6288
- /* Enable function calling. This will disable the grammar setting */
6289
- functionCallEnabled?: boolean | DataLink
6290
- /* The function calling schema (similar to https://platform.openai.com/docs/guides/gpt/function-calling) */
6291
- functionCallSchema?: Array<DataLink | {}> | DataLink
6292
6459
  /* Session save mode
6293
6460
  `none` - No session saving
6294
6461
  `prompt` - Save session when prompt processed
@@ -6301,6 +6468,12 @@ Default property:
6301
6468
  sessionRemain?: number | DataLink
6302
6469
  /* TODO:loran_gqarms_norm_epsrope_freq_baserope_freq_scale */
6303
6470
  completionMode?: 'auto' | 'chat' | 'text' | DataLink
6471
+ /* Tools for chat mode */
6472
+ completionTools?: {} | DataLink
6473
+ /* Enable parallel tool calls */
6474
+ completionParallelToolCalls?: boolean | DataLink
6475
+ /* Tool choice for chat mode */
6476
+ completionToolChoice?: 'none' | 'auto' | 'required' | DataLink
6304
6477
  /* Messages (chat mode) */
6305
6478
  completionMessages?:
6306
6479
  | Array<
@@ -6317,6 +6490,19 @@ Default property:
6317
6490
  completionPromptTemplateData?: {} | DataLink
6318
6491
  /* The prompt template type */
6319
6492
  completionPromptTemplateType?: '${}' | '{{}}' | DataLink
6493
+ /* Response format */
6494
+ completionResponseFormat?:
6495
+ | DataLink
6496
+ | {
6497
+ type?: 'text' | 'json_schema' | 'json_object' | DataLink
6498
+ json_schema?:
6499
+ | DataLink
6500
+ | {
6501
+ strict?: boolean | DataLink
6502
+ schema?: {} | DataLink
6503
+ }
6504
+ schema?: {} | DataLink
6505
+ }
6320
6506
  /* Stop words */
6321
6507
  completionStopWords?: Array<string | DataLink> | DataLink
6322
6508
  /* Number of tokens to predict */
@@ -6434,6 +6620,10 @@ Default property:
6434
6620
  type: 'string'
6435
6621
  path: string
6436
6622
  }
6623
+ completionToolCalls: {
6624
+ type: 'array'
6625
+ path: string
6626
+ }
6437
6627
  completionFullContext: {
6438
6628
  type: 'string'
6439
6629
  path: string
@@ -6490,8 +6680,6 @@ Default property:
6490
6680
  completionFullContext?: () => Data
6491
6681
  /* Inference result details */
6492
6682
  completionResultDetails?: () => Data
6493
- /* Last function call details */
6494
- completionLastFunctionCall?: () => Data
6495
6683
  }
6496
6684
  }
6497
6685
 
@@ -6527,7 +6715,6 @@ export type GeneratorLLM = Generator &
6527
6715
  | 'completionResult'
6528
6716
  | 'completionFullContext'
6529
6717
  | 'completionResultDetails'
6530
- | 'completionLastFunctionCall'
6531
6718
  value: any
6532
6719
  }
6533
6720
  }>
@@ -6635,6 +6822,24 @@ Default property:
6635
6822
  }
6636
6823
  >
6637
6824
  | DataLink
6825
+ /* Tools for chat mode */
6826
+ completionTools?: {} | DataLink
6827
+ /* Enable parallel tool calls */
6828
+ completionParallelToolCalls?: boolean | DataLink
6829
+ /* Tool choice for chat mode */
6830
+ completionToolChoice?: 'none' | 'auto' | 'required' | DataLink
6831
+ /* Response format */
6832
+ completionResponseFormat?:
6833
+ | DataLink
6834
+ | {
6835
+ type?: 'text' | 'json_schema' | 'json_object' | DataLink
6836
+ json_schema?:
6837
+ | DataLink
6838
+ | {
6839
+ strict?: boolean | DataLink
6840
+ schema?: {} | DataLink
6841
+ }
6842
+ }
6638
6843
  /* Maximum tokens to generate */
6639
6844
  completionMaxTokens?: number | DataLink
6640
6845
  /* Temperature */
@@ -6647,10 +6852,6 @@ Default property:
6647
6852
  completionPresencePenalty?: number | DataLink
6648
6853
  /* Stop sequences */
6649
6854
  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
6855
  }
6655
6856
  events?: {
6656
6857
  /* Error event */
@@ -7269,7 +7470,7 @@ Default property:
7269
7470
  /* Pooling type of ggml model */
7270
7471
  ggmlPoolingType?: 'none' | 'mean' | 'cls' | 'last' | 'rank' | DataLink
7271
7472
  /* Accelerator variant of ggml model */
7272
- ggmlAccelVariant?: 'default' | 'vulkan' | DataLink
7473
+ ggmlAccelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
7273
7474
  /* Normalize */
7274
7475
  ggmlEmbdNormalize?: number | DataLink
7275
7476
  /* API key of OpenAI Compatible API */