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

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.
@@ -3183,6 +3183,7 @@ Default property:
3183
3183
  "cameraType": "back",
3184
3184
  "cameraPosition": "top",
3185
3185
  "selectColumns": 3,
3186
+ "selectAutoColumns": true,
3186
3187
  "sizeFactor": 1,
3187
3188
  "containerBackgroundColor": "#ffffff",
3188
3189
  "titleColor": "#000000",
@@ -3447,6 +3448,8 @@ Default property:
3447
3448
  doneButtonText?: string | DataLink
3448
3449
  /* Select columns */
3449
3450
  selectColumns?: number | DataLink
3451
+ /* Select auto calculate columns */
3452
+ selectAutoColumns?: boolean | DataLink
3450
3453
  /* Fixed model width, default is auto */
3451
3454
  fixedModelWidth?: number | DataLink
3452
3455
  /* Fixed model height, default is auto */
@@ -4304,6 +4307,515 @@ export type GeneratorSqlite = Generator &
4304
4307
  >
4305
4308
  }
4306
4309
 
4310
+ /* Refresh tools and resources, used for case if tools or resources are changed. Note that the current connections will be closed. */
4311
+ export type GeneratorMCPServerActionRefreshResources = Action & {
4312
+ __actionName: 'GENERATOR_MCP_SERVER_REFRESH_RESOURCES'
4313
+ }
4314
+
4315
+ interface GeneratorMCPServerDef {
4316
+ /*
4317
+ Default property:
4318
+ {
4319
+ "enabled": true,
4320
+ "listening": true,
4321
+ "authType": "none",
4322
+ "name": "bricks-foundation-mcp-server-default",
4323
+ "version": "1.0.0",
4324
+ "resources": [],
4325
+ "tools": [],
4326
+ "prompts": []
4327
+ }
4328
+ */
4329
+ property?: {
4330
+ /* Enable MCP server. If enabled and Listening is false, the generator can still provide application-scoped resources. */
4331
+ enabled?: boolean | DataLink
4332
+ /* Application-scoped generator key, key cannot be the same with other application-scoped generators */
4333
+ globalGeneratorKey?: string | DataLink
4334
+ /* Start MCP server */
4335
+ listening?: boolean | DataLink
4336
+ /* HTTP server port */
4337
+ port?: number | DataLink
4338
+ /* Authorization type of HTTP request */
4339
+ authType?: 'none' | 'bearer' | DataLink
4340
+ /* Token of bearer auth */
4341
+ bearerToken?: string | DataLink
4342
+ /* Name of the MCP server */
4343
+ name?: string | DataLink
4344
+ /* Version of the MCP server */
4345
+ version?: string | DataLink
4346
+ /* Resources
4347
+ Type:
4348
+ `static`: Return static data
4349
+ `detect-data-change`: Watch data target change to return data,
4350
+ please update data with ({ id: string, content: string | object }),
4351
+ and ensure the id is same with request id
4352
+ `script`: Not implemented yet */
4353
+ resources?:
4354
+ | Array<
4355
+ | DataLink
4356
+ | {
4357
+ enabled?: boolean | DataLink
4358
+ name?: string | DataLink
4359
+ description?: string | DataLink
4360
+ uriOrTemplate?: string | DataLink
4361
+ type?: 'static' | 'detect-data-change' | 'script' | DataLink
4362
+ staticData?: any
4363
+ dataChangeConfig?:
4364
+ | DataLink
4365
+ | {
4366
+ target?: string | DataLink
4367
+ timeout?: number | DataLink
4368
+ payload?: any
4369
+ }
4370
+ scriptConfig?:
4371
+ | DataLink
4372
+ | {
4373
+ code?: string | DataLink
4374
+ timeout?: number | DataLink
4375
+ members?:
4376
+ | Array<
4377
+ | DataLink
4378
+ | {
4379
+ handler?: string | DataLink
4380
+ varName?: string | DataLink
4381
+ }
4382
+ >
4383
+ | DataLink
4384
+ payload?: any
4385
+ }
4386
+ }
4387
+ >
4388
+ | DataLink
4389
+ /* Tools
4390
+ Type:
4391
+ `detect-data-change`: Watch data target change to return data,
4392
+ please update data with ({ id: string, content: string | object }),
4393
+ and ensure the id is same with request id.
4394
+ `script`: Not implemented yet */
4395
+ tools?:
4396
+ | Array<
4397
+ | DataLink
4398
+ | {
4399
+ enabled?: boolean | DataLink
4400
+ name?: string | DataLink
4401
+ description?: string | DataLink
4402
+ params?: {} | DataLink
4403
+ type?: 'detect-data-change' | 'script' | DataLink
4404
+ dataChangeConfig?:
4405
+ | DataLink
4406
+ | {
4407
+ target?: string | DataLink
4408
+ timeout?: number | DataLink
4409
+ payload?: any
4410
+ }
4411
+ scriptConfig?:
4412
+ | DataLink
4413
+ | {
4414
+ code?: string | DataLink
4415
+ timeout?: number | DataLink
4416
+ members?:
4417
+ | Array<
4418
+ | DataLink
4419
+ | {
4420
+ handler?: string | DataLink
4421
+ varName?: string | DataLink
4422
+ }
4423
+ >
4424
+ | DataLink
4425
+ payload?: any
4426
+ }
4427
+ }
4428
+ >
4429
+ | DataLink
4430
+ /* Prompts
4431
+ Type:
4432
+ `static`: Return static data
4433
+ `detect-data-change`: Watch data target change to return data,
4434
+ please update data with ({ id: string, content: string | object }),
4435
+ and ensure the id is same with request id
4436
+ `script`: Not implemented yet */
4437
+ prompts?:
4438
+ | Array<
4439
+ | DataLink
4440
+ | {
4441
+ enabled?: boolean | DataLink
4442
+ name?: string | DataLink
4443
+ description?: string | DataLink
4444
+ arguments?: {} | DataLink
4445
+ type?: 'static' | 'detect-data-change' | 'script' | DataLink
4446
+ staticData?: any
4447
+ dataChangeConfig?:
4448
+ | DataLink
4449
+ | {
4450
+ target?: string | DataLink
4451
+ timeout?: number | DataLink
4452
+ payload?: any
4453
+ }
4454
+ scriptConfig?:
4455
+ | DataLink
4456
+ | {
4457
+ code?: string | DataLink
4458
+ timeout?: number | DataLink
4459
+ members?:
4460
+ | Array<
4461
+ | DataLink
4462
+ | {
4463
+ handler?: string | DataLink
4464
+ varName?: string | DataLink
4465
+ }
4466
+ >
4467
+ | DataLink
4468
+ payload?: any
4469
+ }
4470
+ }
4471
+ >
4472
+ | DataLink
4473
+ }
4474
+ events?: {
4475
+ /* Listening of HTTP server */
4476
+ onListening?: Array<EventAction>
4477
+ /* Error of HTTP server */
4478
+ onError?: Array<EventAction>
4479
+ /* Client error of HTTP server */
4480
+ onClientError?: Array<EventAction>
4481
+ /* Client close of HTTP server */
4482
+ onClientClose?: Array<EventAction>
4483
+ /* On request resource (Request: { name: string, uri: string, params: object }) */
4484
+ onRequestResource?: Array<EventAction>
4485
+ /* On call tool (Request: { name: string, params: object }) */
4486
+ onCallTool?: Array<EventAction>
4487
+ /* On get prompt (Request: { name: string, arguments: object }) */
4488
+ onGetPrompt?: Array<EventAction>
4489
+ }
4490
+ outlets?: {
4491
+ /* Whether the HTTP server is listening */
4492
+ isListening?: () => Data
4493
+ /* Last error of HTTP server */
4494
+ lastError?: () => Data
4495
+ /* MCP server endpoint URL */
4496
+ endpoint?: () => Data
4497
+ /* Connected remotes (Session ID) */
4498
+ connectedRemotes?: () => Data
4499
+ /* Last resource request ({ name: string, uri: string, params: object }) */
4500
+ lastResourceRequest?: () => Data
4501
+ /* Last tool call ({ name: string, params: object }) */
4502
+ lastToolCall?: () => Data
4503
+ /* Last prompt get ({ name: string, arguments: object }) */
4504
+ lastPromptGet?: () => Data
4505
+ }
4506
+ }
4507
+
4508
+ /* Model Context Protocol (MCP) Server (https://docs.anthropic.com/en/docs/agents-and-tools/mcp) */
4509
+ export type GeneratorMCPServer = Generator &
4510
+ GeneratorMCPServerDef & {
4511
+ templateKey: 'GENERATOR_MCP_SERVER'
4512
+ switches: Array<
4513
+ SwitchDef &
4514
+ GeneratorMCPServerDef & {
4515
+ conds?: Array<{
4516
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
4517
+ cond:
4518
+ | SwitchCondInnerStateCurrentCanvas
4519
+ | SwitchCondData
4520
+ | {
4521
+ __typename: 'SwitchCondInnerStateOutlet'
4522
+ outlet:
4523
+ | 'isListening'
4524
+ | 'lastError'
4525
+ | 'endpoint'
4526
+ | 'connectedRemotes'
4527
+ | 'lastResourceRequest'
4528
+ | 'lastToolCall'
4529
+ | 'lastPromptGet'
4530
+ value: any
4531
+ }
4532
+ }>
4533
+ }
4534
+ >
4535
+ }
4536
+
4537
+ /* Connect to MCP server */
4538
+ export type GeneratorMCPActionConnect = Action & {
4539
+ __actionName: 'GENERATOR_MCP_CONNECT'
4540
+ }
4541
+
4542
+ /* Disconnect from MCP server */
4543
+ export type GeneratorMCPActionDisconnect = Action & {
4544
+ __actionName: 'GENERATOR_MCP_DISCONNECT'
4545
+ }
4546
+
4547
+ /* List resources */
4548
+ export type GeneratorMCPActionListResources = ActionWithParams & {
4549
+ __actionName: 'GENERATOR_MCP_LIST_RESOURCES'
4550
+ params?: Array<{
4551
+ input: 'requestId'
4552
+ value?: string | DataLink | EventProperty
4553
+ mapping?: string
4554
+ }>
4555
+ }
4556
+
4557
+ /* List resource templates */
4558
+ export type GeneratorMCPActionListResourceTemplates = ActionWithParams & {
4559
+ __actionName: 'GENERATOR_MCP_LIST_RESOURCE_TEMPLATES'
4560
+ params?: Array<{
4561
+ input: 'requestId'
4562
+ value?: string | DataLink | EventProperty
4563
+ mapping?: string
4564
+ }>
4565
+ }
4566
+
4567
+ /* Read resource */
4568
+ export type GeneratorMCPActionReadResource = ActionWithParams & {
4569
+ __actionName: 'GENERATOR_MCP_READ_RESOURCE'
4570
+ params?: Array<
4571
+ | {
4572
+ input: 'requestId'
4573
+ value?: string | DataLink | EventProperty
4574
+ mapping?: string
4575
+ }
4576
+ | {
4577
+ input: 'uri'
4578
+ value?: string | DataLink | EventProperty
4579
+ mapping?: string
4580
+ }
4581
+ | {
4582
+ input: 'variables'
4583
+ value?: {} | DataLink | EventProperty
4584
+ mapping?: string
4585
+ }
4586
+ >
4587
+ }
4588
+
4589
+ /* List tools */
4590
+ export type GeneratorMCPActionListTools = ActionWithParams & {
4591
+ __actionName: 'GENERATOR_MCP_LIST_TOOLS'
4592
+ params?: Array<{
4593
+ input: 'requestId'
4594
+ value?: string | DataLink | EventProperty
4595
+ mapping?: string
4596
+ }>
4597
+ }
4598
+
4599
+ /* Call tool */
4600
+ export type GeneratorMCPActionCallTool = ActionWithParams & {
4601
+ __actionName: 'GENERATOR_MCP_CALL_TOOL'
4602
+ params?: Array<
4603
+ | {
4604
+ input: 'requestId'
4605
+ value?: string | DataLink | EventProperty
4606
+ mapping?: string
4607
+ }
4608
+ | {
4609
+ input: 'name'
4610
+ value?: string | DataLink | EventProperty
4611
+ mapping?: string
4612
+ }
4613
+ | {
4614
+ input: 'variables'
4615
+ value?: {} | DataLink | EventProperty
4616
+ mapping?: string
4617
+ }
4618
+ >
4619
+ }
4620
+
4621
+ /* List prompts */
4622
+ export type GeneratorMCPActionListPrompts = ActionWithParams & {
4623
+ __actionName: 'GENERATOR_MCP_LIST_PROMPTS'
4624
+ params?: Array<{
4625
+ input: 'requestId'
4626
+ value?: string | DataLink | EventProperty
4627
+ mapping?: string
4628
+ }>
4629
+ }
4630
+
4631
+ /* Request prompt */
4632
+ export type GeneratorMCPActionGetPrompt = ActionWithParams & {
4633
+ __actionName: 'GENERATOR_MCP_GET_PROMPT'
4634
+ params?: Array<
4635
+ | {
4636
+ input: 'requestId'
4637
+ value?: string | DataLink | EventProperty
4638
+ mapping?: string
4639
+ }
4640
+ | {
4641
+ input: 'name'
4642
+ value?: string | DataLink | EventProperty
4643
+ mapping?: string
4644
+ }
4645
+ | {
4646
+ input: 'variables'
4647
+ value?: {} | DataLink | EventProperty
4648
+ mapping?: string
4649
+ }
4650
+ >
4651
+ }
4652
+
4653
+ interface GeneratorMCPDef {
4654
+ /*
4655
+ Default property:
4656
+ {
4657
+ "init": false,
4658
+ "type": "streamable-http",
4659
+ "url": "",
4660
+ "autoReconnect": true,
4661
+ "maxReconnectAttempts": 10,
4662
+ "reconnectInterval": 1000,
4663
+ "generatorId": "",
4664
+ "generatorKey": "",
4665
+ "name": "bricks-foundation-mcp-client-default",
4666
+ "version": "1.0.0",
4667
+ "ignoreResourceInList": [],
4668
+ "ignoreToolInList": [],
4669
+ "ignorePromptInList": [],
4670
+ "requestTimeout": 60000
4671
+ }
4672
+ */
4673
+ property?: {
4674
+ /* Initialize the MCP client on start */
4675
+ init?: boolean | DataLink
4676
+ /* Type of the MCP connection, e.g. sse or direct-link (generator) */
4677
+ type?: 'streamable-http' | 'sse' | 'direct-link' | DataLink
4678
+ /* URL of the MCP server, e.g. http://localhost:19853/sse */
4679
+ url?: string | DataLink
4680
+ /* Whether to automatically reconnect to the MCP server */
4681
+ autoReconnect?: boolean | DataLink
4682
+ /* Maximum number of reconnection attempts */
4683
+ maxReconnectAttempts?: number | DataLink
4684
+ /* Reconnection interval in milliseconds */
4685
+ reconnectInterval?: number | DataLink
4686
+ /* SSE connection headers */
4687
+ sseHeaders?: {} | DataLink
4688
+ /* Send request headers */
4689
+ sendHeaders?: {} | DataLink
4690
+ /* Bearer token for authentication */
4691
+ bearerToken?: string | DataLink
4692
+ /* Generator MCP Server ID for direct link */
4693
+ generatorId?: string | DataLink
4694
+ /* Application-scoped key of Generator MCP Server for direct link (If ID is not provided) */
4695
+ generatorKey?: string | DataLink
4696
+ /* Name of the MCP client */
4697
+ name?: string | DataLink
4698
+ /* Version of the MCP client */
4699
+ version?: string | DataLink
4700
+ /* Ignore resources in list response */
4701
+ ignoreResourceInList?: Array<string | DataLink> | DataLink
4702
+ /* Ignore tools in list response */
4703
+ ignoreToolInList?: Array<string | DataLink> | DataLink
4704
+ /* Ignore prompts in list response */
4705
+ ignorePromptInList?: Array<string | DataLink> | DataLink
4706
+ /* Request timeout in milliseconds */
4707
+ requestTimeout?: number | DataLink
4708
+ }
4709
+ events?: {
4710
+ /* On connected */
4711
+ onConnected?: Array<EventAction>
4712
+ /* On connection error */
4713
+ onConnectionError?: Array<EventAction>
4714
+ /* On disconnected */
4715
+ onDisconnected?: Array<EventAction>
4716
+ /* On list resources */
4717
+ onListResources?: Array<EventAction>
4718
+ /* On list resources error */
4719
+ onListResourcesError?: Array<EventAction>
4720
+ /* On list resource templates */
4721
+ onListResourceTemplates?: Array<EventAction>
4722
+ /* On list resource templates error */
4723
+ onListResourceTemplatesError?: Array<EventAction>
4724
+ /* On read resource */
4725
+ onReadResource?: Array<EventAction>
4726
+ /* On read resource error */
4727
+ onReadResourceError?: Array<EventAction>
4728
+ /* On list tools */
4729
+ onListTools?: Array<EventAction>
4730
+ /* On list tools error */
4731
+ onListToolsError?: Array<EventAction>
4732
+ /* On call tool */
4733
+ onCallTool?: Array<EventAction>
4734
+ /* On call tool error */
4735
+ onCallToolError?: Array<EventAction>
4736
+ /* On list prompts */
4737
+ onListPrompts?: Array<EventAction>
4738
+ /* On list prompts error */
4739
+ onListPromptsError?: Array<EventAction>
4740
+ /* On get prompt */
4741
+ onGetPrompt?: Array<EventAction>
4742
+ /* On get prompt error */
4743
+ onGetPromptError?: Array<EventAction>
4744
+ }
4745
+ outlets?: {
4746
+ /* Connection state */
4747
+ connectionState?: () => Data
4748
+ /* List resources response */
4749
+ listResourcesResponse?: () => Data
4750
+ /* List resources error */
4751
+ listResourcesError?: () => Data
4752
+ /* List resource templates response */
4753
+ listResourceTemplatesResponse?: () => Data
4754
+ /* List resource templates error */
4755
+ listResourceTemplatesError?: () => Data
4756
+ /* Read resource response */
4757
+ readResourceResponse?: () => Data
4758
+ /* Read resource error */
4759
+ readResourceError?: () => Data
4760
+ /* List tools response */
4761
+ listToolsResponse?: () => Data
4762
+ /* List tools error */
4763
+ listToolsError?: () => Data
4764
+ /* Call tool response */
4765
+ callToolResponse?: () => Data
4766
+ /* Call tool error */
4767
+ callToolError?: () => Data
4768
+ /* List prompts response */
4769
+ listPromptsResponse?: () => Data
4770
+ /* List prompts error */
4771
+ listPromptsError?: () => Data
4772
+ /* Get prompt response */
4773
+ getPromptResponse?: () => Data
4774
+ /* Request prompt error */
4775
+ getPromptError?: () => Data
4776
+ /* Last error */
4777
+ lastError?: () => Data
4778
+ }
4779
+ }
4780
+
4781
+ /* Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link */
4782
+ export type GeneratorMCP = Generator &
4783
+ GeneratorMCPDef & {
4784
+ templateKey: 'GENERATOR_MCP'
4785
+ switches: Array<
4786
+ SwitchDef &
4787
+ GeneratorMCPDef & {
4788
+ conds?: Array<{
4789
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
4790
+ cond:
4791
+ | SwitchCondInnerStateCurrentCanvas
4792
+ | SwitchCondData
4793
+ | {
4794
+ __typename: 'SwitchCondInnerStateOutlet'
4795
+ outlet:
4796
+ | 'connectionState'
4797
+ | 'listResourcesResponse'
4798
+ | 'listResourcesError'
4799
+ | 'listResourceTemplatesResponse'
4800
+ | 'listResourceTemplatesError'
4801
+ | 'readResourceResponse'
4802
+ | 'readResourceError'
4803
+ | 'listToolsResponse'
4804
+ | 'listToolsError'
4805
+ | 'callToolResponse'
4806
+ | 'callToolError'
4807
+ | 'listPromptsResponse'
4808
+ | 'listPromptsError'
4809
+ | 'getPromptResponse'
4810
+ | 'getPromptError'
4811
+ | 'lastError'
4812
+ value: any
4813
+ }
4814
+ }>
4815
+ }
4816
+ >
4817
+ }
4818
+
4307
4819
  /* Load the model */
4308
4820
  export type GeneratorTTSActionLoadModel = Action & {
4309
4821
  __actionName: 'GENERATOR_TTS_LOAD_MODEL'
@@ -4481,6 +4993,11 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
4481
4993
  value?: Array<any> | DataLink | EventProperty
4482
4994
  mapping?: string
4483
4995
  }
4996
+ | {
4997
+ input: 'images'
4998
+ value?: Array<any> | DataLink | EventProperty
4999
+ mapping?: string
5000
+ }
4484
5001
  >
4485
5002
  }
4486
5003
 
@@ -4517,12 +5034,17 @@ Default property:
4517
5034
  /* LLM model */
4518
5035
  model?:
4519
5036
  | 'Custom'
5037
+ | 'onnx-community/gemma-3-1b-it-ONNX'
4520
5038
  | 'BricksDisplay/phi-1_5'
4521
5039
  | 'BricksDisplay/phi-1_5-q4'
4522
- | 'Qwen1.5-0.5B'
4523
- | 'Qwen1.5-1.8B'
4524
- | 'Qwen1.5-0.5B-Chat'
4525
- | 'Qwen1.5-1.8B-Chat'
5040
+ | 'onnx-community/Phi-3.5-vision-instruct'
5041
+ | 'onnx-community/Phi-3-vision-128k-instruct'
5042
+ | 'onnx-community/Phi-4-mini-instruct-ONNX-MHA'
5043
+ | 'onnx-community/Qwen2.5-0.5B'
5044
+ | 'onnx-community/Qwen2.5-0.5B-Instruct'
5045
+ | 'onnx-community/Qwen2.5-1.5B'
5046
+ | 'onnx-community/Qwen2.5-1.5B-Instruct'
5047
+ | 'onnx-community/Qwen2-VL-2B-Instruct'
4526
5048
  | 'stablelm-2-1_6b'
4527
5049
  | 'BricksDisplay/stablelm-2-1_6b-q4'
4528
5050
  | 'stablelm-2-zephyr-1_6b'
@@ -4595,6 +5117,12 @@ Default property:
4595
5117
  Choose model from https://huggingface.co/models?pipeline_tag=text2text-generation&library=transformers.js
4596
5118
  or https://huggingface.co/models?pipeline_tag=text-generation&library=transformers.js&sort=trending */
4597
5119
  customModel?: string | DataLink
5120
+ /* Prompt to inference */
5121
+ prompt?: string | DataLink
5122
+ /* Messages to inference */
5123
+ messages?: Array<DataLink | {}> | DataLink
5124
+ /* Images with message to inference */
5125
+ images?: Array<string | DataLink> | DataLink
4598
5126
  /* Max new tokens to generate */
4599
5127
  maxNewTokens?: number | DataLink
4600
5128
  /* Temperature */
@@ -5644,6 +6172,7 @@ Default property:
5644
6172
  "useMmap": true,
5645
6173
  "cacheKType": "f16",
5646
6174
  "cacheVType": "f16",
6175
+ "ctxShift": true,
5647
6176
  "transformScriptEnabled": false,
5648
6177
  "transformScriptCode": "\/\* Global variable: inputs = { prompt, messages, variables } \*\/\nreturn inputs.prompt",
5649
6178
  "transformScriptVariables": {},
@@ -5729,6 +6258,8 @@ Default property:
5729
6258
  cacheKType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink
5730
6259
  /* KV cache data type for the V (Default: f16) */
5731
6260
  cacheVType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink
6261
+ /* Enable context shift */
6262
+ ctxShift?: boolean | DataLink
5732
6263
  /* Enable Transform Script for processing the prompt */
5733
6264
  transformScriptEnabled?: boolean | DataLink
5734
6265
  /* Code of Transform Script */
@@ -5747,8 +6278,10 @@ Default property:
5747
6278
  sessionRemain?: number | DataLink
5748
6279
  /* TODO:loran_gqarms_norm_epsrope_freq_baserope_freq_scale */
5749
6280
  completionMode?: 'auto' | 'chat' | 'text' | DataLink
5750
- /* Tools for chat mode */
5751
- completionTools?: {} | DataLink
6281
+ /* Tools for chat mode using OpenAI-compatible function calling format
6282
+ Format: Array of objects with {type, function: {name, description, parameters}} structure
6283
+ See: https://platform.openai.com/docs/guides/function-calling */
6284
+ completionTools?: Array<{} | DataLink> | DataLink
5752
6285
  /* Enable parallel tool calls */
5753
6286
  completionParallelToolCalls?: boolean | DataLink
5754
6287
  /* Tool choice for chat mode */
@@ -5914,6 +6447,168 @@ export type GeneratorLLM = Generator &
5914
6447
  >
5915
6448
  }
5916
6449
 
6450
+ /* Load the model */
6451
+ export type GeneratorQnnLlmActionLoadModel = Action & {
6452
+ __actionName: 'GENERATOR_QNN_LLM_LOAD_MODEL'
6453
+ }
6454
+
6455
+ /* Abort model download */
6456
+ export type GeneratorQnnLlmActionAbortModelDownload = Action & {
6457
+ __actionName: 'GENERATOR_QNN_LLM_ABORT_MODEL_DOWNLOAD'
6458
+ }
6459
+
6460
+ /* Generate text */
6461
+ export type GeneratorQnnLlmActionGenerate = ActionWithParams & {
6462
+ __actionName: 'GENERATOR_QNN_LLM_GENERATE'
6463
+ params?: Array<
6464
+ | {
6465
+ input: 'prompt'
6466
+ value?: string | DataLink | EventProperty
6467
+ mapping?: string
6468
+ }
6469
+ | {
6470
+ input: 'messages'
6471
+ value?: Array<any> | DataLink | EventProperty
6472
+ mapping?: string
6473
+ }
6474
+ >
6475
+ }
6476
+
6477
+ /* Abort generation */
6478
+ export type GeneratorQnnLlmActionAbortGeneration = Action & {
6479
+ __actionName: 'GENERATOR_QNN_LLM_ABORT_GENERATION'
6480
+ }
6481
+
6482
+ /* Release context */
6483
+ export type GeneratorQnnLlmActionReleaseContext = Action & {
6484
+ __actionName: 'GENERATOR_QNN_LLM_RELEASE_CONTEXT'
6485
+ }
6486
+
6487
+ interface GeneratorQnnLlmDef {
6488
+ /*
6489
+ Default property:
6490
+ {
6491
+ "modelType": "Llama 3.2 3B Chat",
6492
+ "chatFormat": "Llama 3.x",
6493
+ "toolCallParser": "llama3_json",
6494
+ "toolChoice": "auto",
6495
+ "parallelToolCalls": false,
6496
+ "greedy": false
6497
+ }
6498
+ */
6499
+ property?: {
6500
+ /* Load model context when generator is initialized */
6501
+ init?: boolean | DataLink
6502
+ /* Model type */
6503
+ modelType?:
6504
+ | 'Llama 3 8B Chat'
6505
+ | 'Llama 3.1 8B Chat'
6506
+ | 'Llama 3.2 3B Chat'
6507
+ | 'Mistral 7B Instruct v0.3'
6508
+ | 'Qwen 2 7B Chat'
6509
+ | 'Phi 3.5 Mini'
6510
+ | 'Granite v3.1 8B Instruct'
6511
+ | 'Custom'
6512
+ | DataLink
6513
+ /* SOC model */
6514
+ socModel?: 'X Elite' | 'X Plus' | '8 Elite' | '8 Gen 3' | 'QCS8550' | DataLink
6515
+ /* Custom model base URL
6516
+ The URL directory should contain `config.json` (model config) file, `model_part_*_of_*.bin` (model split files) files and `tokenizer.json` (tokenizer config) file. */
6517
+ customModelUrl?: string | DataLink
6518
+ /* Custom model split parts */
6519
+ customModelSplitParts?: number | DataLink
6520
+ /* Chat format */
6521
+ chatFormat?: 'Llama 2' | 'Llama 3' | 'Llama 3.x' | 'Mistral v0.3' | 'Qwen 2' | DataLink
6522
+ /* Custom chat format template */
6523
+ customChatFormat?: string | DataLink
6524
+ /* Prompt to generate */
6525
+ prompt?: string | DataLink
6526
+ /* Chat messages */
6527
+ messages?:
6528
+ | Array<
6529
+ | DataLink
6530
+ | {
6531
+ role?: string | DataLink
6532
+ content?: string | DataLink
6533
+ }
6534
+ >
6535
+ | DataLink
6536
+ /* Stop words */
6537
+ stopWords?: Array<string | DataLink> | DataLink
6538
+ /* Tool call parser */
6539
+ toolCallParser?: 'llama3_json' | 'mistral' | DataLink
6540
+ /* Tools for chat mode using OpenAI-compatible function calling format
6541
+ Format: Array of objects with {type, function: {name, description, parameters}} structure
6542
+ See: https://platform.openai.com/docs/guides/function-calling */
6543
+ tools?: Array<{} | DataLink> | DataLink
6544
+ /* Tool choice for chat mode */
6545
+ toolChoice?: 'none' | 'auto' | 'required' | DataLink
6546
+ /* Enable parallel tool calls */
6547
+ parallelToolCalls?: boolean | DataLink
6548
+ /* Number of threads, -1 to use n-threads from model config */
6549
+ nThreads?: number | DataLink
6550
+ /* Temperature, -1 to use temperature from model config */
6551
+ temperature?: number | DataLink
6552
+ /* Seed, -1 to use seed from model config */
6553
+ seed?: number | DataLink
6554
+ /* Top K, -1 to use top-k from model config */
6555
+ topK?: number | DataLink
6556
+ /* Top P, -1 to use top-p from model config */
6557
+ topP?: number | DataLink
6558
+ /* Greedy, use greedy sampling */
6559
+ greedy?: boolean | DataLink
6560
+ }
6561
+ events?: {
6562
+ /* Event triggered when load is done */
6563
+ onContextStateChange?: Array<EventAction>
6564
+ /* Event triggered when generate is done */
6565
+ onGenerate?: Array<EventAction>
6566
+ /* Event triggered on get function call request */
6567
+ onFunctionCall?: Array<EventAction>
6568
+ /* Event triggered when error occurs */
6569
+ onError?: Array<EventAction>
6570
+ }
6571
+ outlets?: {
6572
+ /* Context state */
6573
+ contextState?: () => Data
6574
+ /* Generation result */
6575
+ result?: () => Data
6576
+ /* Full context (Prompt + Generation Result) */
6577
+ fullContext?: () => Data
6578
+ /* Last function call details */
6579
+ lastFunctionCall?: () => Data
6580
+ /* Completion details */
6581
+ completionDetails?: () => Data
6582
+ }
6583
+ }
6584
+
6585
+ /* Local LLM inference using Qualcomm AI Engine */
6586
+ export type GeneratorQnnLlm = Generator &
6587
+ GeneratorQnnLlmDef & {
6588
+ templateKey: 'GENERATOR_QNN_LLM'
6589
+ switches: Array<
6590
+ SwitchDef &
6591
+ GeneratorQnnLlmDef & {
6592
+ conds?: Array<{
6593
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
6594
+ cond:
6595
+ | SwitchCondInnerStateCurrentCanvas
6596
+ | SwitchCondData
6597
+ | {
6598
+ __typename: 'SwitchCondInnerStateOutlet'
6599
+ outlet:
6600
+ | 'contextState'
6601
+ | 'result'
6602
+ | 'fullContext'
6603
+ | 'lastFunctionCall'
6604
+ | 'completionDetails'
6605
+ value: any
6606
+ }
6607
+ }>
6608
+ }
6609
+ >
6610
+ }
6611
+
5917
6612
  /* Run text completion */
5918
6613
  export type GeneratorOpenAILLMActionCompletion = ActionWithParams & {
5919
6614
  __actionName: 'GENERATOR_OPENAI_LLM_COMPLETION'
@@ -5988,7 +6683,10 @@ Default property:
5988
6683
  "apiEndpoint": "https://api.openai.com/v1",
5989
6684
  "model": "gpt-4o-mini",
5990
6685
  "completionMessages": [
5991
- null
6686
+ {
6687
+ "role": "system",
6688
+ "content": "You are a helpful assistant."
6689
+ }
5992
6690
  ],
5993
6691
  "completionMaxTokens": 1024,
5994
6692
  "completionTemperature": 1,
@@ -6024,8 +6722,10 @@ Default property:
6024
6722
  }
6025
6723
  >
6026
6724
  | DataLink
6027
- /* Tools for chat mode */
6028
- completionTools?: {} | DataLink
6725
+ /* Tools for chat mode following OpenAI function calling format
6726
+ Format: Array of objects with {type, function: {name, description, parameters}} structure
6727
+ See: https://platform.openai.com/docs/guides/function-calling */
6728
+ completionTools?: Array<{} | DataLink> | DataLink
6029
6729
  /* Enable parallel tool calls */
6030
6730
  completionParallelToolCalls?: boolean | DataLink
6031
6731
  /* Tool choice for chat mode */
@@ -6103,6 +6803,104 @@ export type GeneratorOpenAILLM = Generator &
6103
6803
  >
6104
6804
  }
6105
6805
 
6806
+ /* Generate audio */
6807
+ export type GeneratorOpenAiTTSActionGenerate = ActionWithParams & {
6808
+ __actionName: 'GENERATOR_OPENAI_TTS_GENERATE'
6809
+ params?: Array<{
6810
+ input: 'text'
6811
+ value?: string | DataLink | EventProperty
6812
+ mapping?: string
6813
+ }>
6814
+ }
6815
+
6816
+ /* Clean cache */
6817
+ export type GeneratorOpenAiTTSActionCleanCache = Action & {
6818
+ __actionName: 'GENERATOR_OPENAI_TTS_CLEAN_CACHE'
6819
+ }
6820
+
6821
+ interface GeneratorOpenAiTTSDef {
6822
+ /*
6823
+ Default property:
6824
+ {
6825
+ "apiEndpoint": "https://api.openai.com/v1",
6826
+ "model": "tts-1",
6827
+ "voice": "alloy",
6828
+ "speed": 1,
6829
+ "outputType": "play",
6830
+ "playbackVolume": 100,
6831
+ "cacheGenerated": true,
6832
+ "autoInferEnable": false,
6833
+ "softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
6834
+ "hardBreakTime": 500
6835
+ }
6836
+ */
6837
+ property?: {
6838
+ /* API endpoint URL */
6839
+ apiEndpoint?: string | DataLink
6840
+ /* OpenAI API Key */
6841
+ apiKey?: string | DataLink
6842
+ /* OpenAI TTS model */
6843
+ model?: string | DataLink
6844
+ /* Voice to use
6845
+ Select voice from https://openai.fm , default alloy */
6846
+ voice?: string | DataLink
6847
+ /* Additional instructions for the speech generation */
6848
+ instructions?: string | DataLink
6849
+ /* Speed of the generated audio */
6850
+ speed?: number | DataLink
6851
+ /* Output mode */
6852
+ outputType?: 'play' | 'file' | DataLink
6853
+ /* Playback volume (0 - 100) */
6854
+ playbackVolume?: number | DataLink
6855
+ /* Enable cache for generated audio */
6856
+ cacheGenerated?: boolean | DataLink
6857
+ /* Text to generate */
6858
+ prompt?: string | DataLink
6859
+ /* Auto inference when prompt changes */
6860
+ autoInferEnable?: boolean | DataLink
6861
+ /* Segmentation rule for auto inference */
6862
+ softBreakRegex?: string | DataLink
6863
+ /* Time to force inference when softBreakRegex is not satisfied */
6864
+ hardBreakTime?: number | DataLink
6865
+ }
6866
+ events?: {
6867
+ /* Event triggered when state change */
6868
+ onContextStateChange?: Array<EventAction>
6869
+ /* Event triggered when error occurs */
6870
+ onError?: Array<EventAction>
6871
+ }
6872
+ outlets?: {
6873
+ /* Context state */
6874
+ contextState?: () => Data
6875
+ /* Generated audio file */
6876
+ generatedAudio?: () => Data
6877
+ /* Generated audio file is playing */
6878
+ generatedAudioPlaying?: () => Data
6879
+ }
6880
+ }
6881
+
6882
+ /* Generate speech from text using OpenAI's Text-to-Speech API */
6883
+ export type GeneratorOpenAiTTS = Generator &
6884
+ GeneratorOpenAiTTSDef & {
6885
+ templateKey: 'GENERATOR_OPENAI_TTS'
6886
+ switches: Array<
6887
+ SwitchDef &
6888
+ GeneratorOpenAiTTSDef & {
6889
+ conds?: Array<{
6890
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
6891
+ cond:
6892
+ | SwitchCondInnerStateCurrentCanvas
6893
+ | SwitchCondData
6894
+ | {
6895
+ __typename: 'SwitchCondInnerStateOutlet'
6896
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
6897
+ value: any
6898
+ }
6899
+ }>
6900
+ }
6901
+ >
6902
+ }
6903
+
6106
6904
  /* Add a message to the assistant */
6107
6905
  export type GeneratorAssistantActionAddMessage = ActionWithParams & {
6108
6906
  __actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
@@ -6160,6 +6958,55 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
6160
6958
  >
6161
6959
  }
6162
6960
 
6961
+ /* Initialize messages from MCP prompt */
6962
+ export type GeneratorAssistantActionInitMcpPrompt = ActionWithParams & {
6963
+ __actionName: 'GENERATOR_ASSISTANT_INIT_MCP_PROMPT'
6964
+ params?: Array<
6965
+ | {
6966
+ input: 'mcpClientName'
6967
+ value?: string | DataLink | EventProperty
6968
+ mapping?: string
6969
+ }
6970
+ | {
6971
+ input: 'mcpPromptName'
6972
+ value?: string | DataLink | EventProperty
6973
+ mapping?: string
6974
+ }
6975
+ | {
6976
+ input: 'mcpArguments'
6977
+ value?: {} | DataLink | EventProperty
6978
+ mapping?: string
6979
+ }
6980
+ | {
6981
+ input: 'firstMessageAsSystem'
6982
+ value?: boolean | DataLink | EventProperty
6983
+ mapping?: string
6984
+ }
6985
+ >
6986
+ }
6987
+
6988
+ /* Add messages from MCP prompt */
6989
+ export type GeneratorAssistantActionAddMcpPromptMessage = ActionWithParams & {
6990
+ __actionName: 'GENERATOR_ASSISTANT_ADD_MCP_PROMPT_MESSAGE'
6991
+ params?: Array<
6992
+ | {
6993
+ input: 'mcpClientName'
6994
+ value?: string | DataLink | EventProperty
6995
+ mapping?: string
6996
+ }
6997
+ | {
6998
+ input: 'mcpPromptName'
6999
+ value?: string | DataLink | EventProperty
7000
+ mapping?: string
7001
+ }
7002
+ | {
7003
+ input: 'mcpArguments'
7004
+ value?: {} | DataLink | EventProperty
7005
+ mapping?: string
7006
+ }
7007
+ >
7008
+ }
7009
+
6163
7010
  /* Update a message at a specific index */
6164
7011
  export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
6165
7012
  __actionName: 'GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX'
@@ -6329,8 +7176,25 @@ export type GeneratorAssistantActionReset = Action & {
6329
7176
  }
6330
7177
 
6331
7178
  /* Submit the assistant */
6332
- export type GeneratorAssistantActionSubmit = Action & {
7179
+ export type GeneratorAssistantActionSubmit = ActionWithParams & {
6333
7180
  __actionName: 'GENERATOR_ASSISTANT_SUBMIT'
7181
+ params?: Array<
7182
+ | {
7183
+ input: 'continueOnToolCallConfirm'
7184
+ value?: boolean | DataLink | EventProperty
7185
+ mapping?: string
7186
+ }
7187
+ | {
7188
+ input: 'continueOnToolCallStrategy'
7189
+ value?: 'never' | 'success' | 'always' | DataLink | EventProperty
7190
+ mapping?: string
7191
+ }
7192
+ | {
7193
+ input: 'continueOnToolCallLimit'
7194
+ value?: number | DataLink | EventProperty
7195
+ mapping?: string
7196
+ }
7197
+ >
6334
7198
  }
6335
7199
 
6336
7200
  /* Cancel the assistant responding */
@@ -6338,16 +7202,82 @@ export type GeneratorAssistantActionCancel = Action & {
6338
7202
  __actionName: 'GENERATOR_ASSISTANT_CANCEL'
6339
7203
  }
6340
7204
 
7205
+ /* Check the enabled MCP clients connection status and available tools */
7206
+ export type GeneratorAssistantActionCheckMcpServers = Action & {
7207
+ __actionName: 'GENERATOR_ASSISTANT_CHECK_MCP_SERVERS'
7208
+ }
7209
+
7210
+ /* Insert an MCP resource as a new assistant message */
7211
+ export type GeneratorAssistantActionInsertMcpResource = ActionWithParams & {
7212
+ __actionName: 'GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE'
7213
+ params?: Array<
7214
+ | {
7215
+ input: 'mcpClientName'
7216
+ value?: string | DataLink | EventProperty
7217
+ mapping?: string
7218
+ }
7219
+ | {
7220
+ input: 'mcpResourceUri'
7221
+ value?: string | DataLink | EventProperty
7222
+ mapping?: string
7223
+ }
7224
+ | {
7225
+ input: 'mcpVariables'
7226
+ value?: {} | DataLink | EventProperty
7227
+ mapping?: string
7228
+ }
7229
+ | {
7230
+ input: 'role'
7231
+ value?: string | DataLink | EventProperty
7232
+ mapping?: string
7233
+ }
7234
+ >
7235
+ }
7236
+
7237
+ /* Summarize messages based on the conversation
7238
+
7239
+ Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
7240
+ export type GeneratorAssistantActionSummaryMessages = ActionWithParams & {
7241
+ __actionName: 'GENERATOR_ASSISTANT_SUMMARY_MESSAGES'
7242
+ params?: Array<
7243
+ | {
7244
+ input: 'summaryMessages'
7245
+ value?: Array<any> | DataLink | EventProperty
7246
+ mapping?: string
7247
+ }
7248
+ | {
7249
+ input: 'summarySessionKey'
7250
+ value?: string | DataLink | EventProperty
7251
+ mapping?: string
7252
+ }
7253
+ >
7254
+ }
7255
+
6341
7256
  interface GeneratorAssistantDef {
6342
7257
  /*
6343
7258
  Default property:
6344
7259
  {
6345
7260
  "initialMessages": [
6346
- null
7261
+ {
7262
+ "role": "system",
7263
+ "content": "You are a helpful assistant."
7264
+ }
6347
7265
  ],
6348
7266
  "cacheMessages": false,
6349
7267
  "llmLivePolicy": "only-in-use",
6350
7268
  "llmSessionKey": "default-assistant",
7269
+ "llmAutoSummaryMessages": false,
7270
+ "llmSummaryMessages": [
7271
+ {
7272
+ "role": "system",
7273
+ "content": "You are a helpful assistant specialized in summarizing conversations. Create a concise summary of the conversation that captures the key points while maintaining important context. The summary should be clear, accurate, and briefer than the original conversation."
7274
+ },
7275
+ {
7276
+ "role": "user",
7277
+ "content": "Please summarize the following conversation into a concise system message that can replace the previous conversation context while maintaining all important information. Here is the conversation to summarize:\n\n"
7278
+ }
7279
+ ],
7280
+ "llmSummarySessionKey": "assistant-default-summary",
6351
7281
  "fileSearchEnabled": false,
6352
7282
  "fileSearchLivePolicy": "only-in-use",
6353
7283
  "sttEnabled": true,
@@ -6371,12 +7301,28 @@ Default property:
6371
7301
  | DataLink
6372
7302
  /* Whether to cache messages */
6373
7303
  cacheMessages?: boolean | DataLink
6374
- /* LLM Generator (Currently only support `LLM (GGML)` generator) */
7304
+ /* LLM Generator (Supports `LLM (GGML)` and `OpenAI LLM` generators) */
6375
7305
  llmGeneratorId?: string | DataLink
6376
7306
  /* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use. */
6377
7307
  llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
6378
7308
  /* LLM main session key */
6379
7309
  llmSessionKey?: string | DataLink
7310
+ /* Auto Summary Messages (Automatically summarize messages when the LLM context is full or content gets truncated, currently only supported with LLM (GGML) generators)
7311
+
7312
+ Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
7313
+ llmAutoSummaryMessages?: boolean | DataLink
7314
+ /* Summary Messages (Messages used for summarization prompt, conversation will be appended to the last message) */
7315
+ llmSummaryMessages?:
7316
+ | Array<
7317
+ | DataLink
7318
+ | {
7319
+ role?: string | DataLink
7320
+ content?: string | DataLink
7321
+ }
7322
+ >
7323
+ | DataLink
7324
+ /* Summary Session Key (Custom session key for summarization) */
7325
+ llmSummarySessionKey?: string | DataLink
6380
7326
  /* File Search (Vector Store) Enabled */
6381
7327
  fileSearchEnabled?: boolean | DataLink
6382
7328
  /* File Search (Vector Store) Generator */
@@ -6389,18 +7335,29 @@ Default property:
6389
7335
  fileSearchThreshold?: number | DataLink
6390
7336
  /* File Search Ignore Threshold. (Default: false) */
6391
7337
  fileSearchIgnoreThreshold?: boolean | DataLink
6392
- /* STT Generator use for transcribing audio message (Currently only support `STT (GGML)` generator) */
7338
+ /* STT Generator use for transcribing audio message (Supports `STT (GGML)` generators) */
6393
7339
  sttGeneratorId?: string | DataLink
6394
7340
  /* STT Enabled */
6395
7341
  sttEnabled?: boolean | DataLink
6396
7342
  /* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when the assistant is not in use. */
6397
7343
  sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
6398
- /* TTS Generator use for generating LLM response audio message (Currently only support `TTS (ONNX)` generator) */
7344
+ /* TTS Generator use for generating LLM response audio message (Supports `TTS (ONNX)` and `OpenAI TTS` generators) */
6399
7345
  ttsGeneratorId?: string | DataLink
6400
7346
  /* TTS Enabled */
6401
7347
  ttsEnabled?: boolean | DataLink
6402
7348
  /* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
6403
7349
  ttsLivePolicy?: 'only-in-use' | 'manual' | DataLink
7350
+ /* MCP Generators (Add a unique name if generator name property are duplicate) */
7351
+ mcpGenerators?:
7352
+ | Array<
7353
+ | DataLink
7354
+ | {
7355
+ generatorId?: string | DataLink
7356
+ name?: string | DataLink
7357
+ enabled?: boolean | DataLink
7358
+ }
7359
+ >
7360
+ | DataLink
6404
7361
  }
6405
7362
  events?: {
6406
7363
  /* Error event */
@@ -6423,6 +7380,8 @@ Default property:
6423
7380
  files?: () => Data
6424
7381
  /* Messages of the assistant */
6425
7382
  messages?: () => Data
7383
+ /* MCP servers status and available tools */
7384
+ mcpServers?: () => Data
6426
7385
  }
6427
7386
  }
6428
7387
 
@@ -6447,6 +7406,7 @@ export type GeneratorAssistant = Generator &
6447
7406
  | 'isBusy'
6448
7407
  | 'files'
6449
7408
  | 'messages'
7409
+ | 'mcpServers'
6450
7410
  value: any
6451
7411
  }
6452
7412
  }>