@almadar/std 14.7.2 → 14.9.0

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.
Files changed (59) hide show
  1. package/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  2. package/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  3. package/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  4. package/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  5. package/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  6. package/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  7. package/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  8. package/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  9. package/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  10. package/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  11. package/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  12. package/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  13. package/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  14. package/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  15. package/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  16. package/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  17. package/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  18. package/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  19. package/behaviors/registry/core/atoms/std-stats.orb +131 -110
  20. package/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  21. package/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  22. package/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  23. package/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  24. package/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  25. package/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  26. package/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  27. package/behaviors/registry/service/atoms/std-service-stripe.orb +121 -95
  28. package/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  29. package/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  30. package/dist/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  31. package/dist/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  32. package/dist/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  33. package/dist/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  34. package/dist/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  35. package/dist/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  36. package/dist/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  37. package/dist/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  38. package/dist/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  39. package/dist/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  40. package/dist/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  41. package/dist/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  42. package/dist/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  43. package/dist/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  44. package/dist/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  45. package/dist/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  46. package/dist/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  47. package/dist/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  48. package/dist/behaviors/registry/core/atoms/std-stats.orb +131 -110
  49. package/dist/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  50. package/dist/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  51. package/dist/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  52. package/dist/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  53. package/dist/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  54. package/dist/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  55. package/dist/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  56. package/dist/behaviors/registry/service/atoms/std-service-stripe.orb +121 -95
  57. package/dist/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  58. package/dist/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  59. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
+ note: `emit-orb` is deprecated — prefer `orb emit orb /home/osamah/kflow.ai.builder/packages/almadar-std/behaviors/lolo/service/atoms/std-service-llm.lolo`
1
2
  {
2
3
  "name": "std-service-llm",
3
- "version": "1.0.0",
4
- "description": "std-service-llm as a Function",
4
+ "version": "2.0.0",
5
+ "description": "std-service-llm LLM completion service. Bind via `uses Llm from \"std/behaviors/std-service-llm\"` and configure `provider` / `model` / `prompt` / `temperature` / `maxTokens` at the call site. Pass `uiTrait: \"@trait.YourLlmForm\"` to inject your own prompt form; leave unset to render the atom's default form (standalone surface).",
5
6
  "orbitals": [
6
7
  {
7
8
  "name": "ServiceLlmOrbital",
@@ -15,14 +16,29 @@
15
16
  "required": true
16
17
  },
17
18
  {
18
- "name": "inputText",
19
+ "name": "provider",
19
20
  "type": "string",
20
- "default": ""
21
+ "default": "openai"
22
+ },
23
+ {
24
+ "name": "model",
25
+ "type": "string",
26
+ "default": "gpt-4"
21
27
  },
22
28
  {
23
- "name": "action",
29
+ "name": "prompt",
24
30
  "type": "string",
25
- "default": "generate"
31
+ "default": ""
32
+ },
33
+ {
34
+ "name": "temperature",
35
+ "type": "number",
36
+ "default": 0.7
37
+ },
38
+ {
39
+ "name": "maxTokens",
40
+ "type": "number",
41
+ "default": 2048.0
26
42
  },
27
43
  {
28
44
  "name": "result",
@@ -64,6 +80,155 @@
64
80
  ]
65
81
  },
66
82
  "traits": [
83
+ {
84
+ "name": "ServiceLlmDefaultForm",
85
+ "category": "interaction",
86
+ "emits": [
87
+ {
88
+ "event": "COMPLETE",
89
+ "scope": "external",
90
+ "payloadSchema": [
91
+ {
92
+ "name": "source",
93
+ "type": "string"
94
+ }
95
+ ]
96
+ }
97
+ ],
98
+ "stateMachine": {
99
+ "states": [
100
+ {
101
+ "name": "ready",
102
+ "isInitial": true
103
+ }
104
+ ],
105
+ "events": [
106
+ {
107
+ "key": "INIT",
108
+ "name": "Initialize"
109
+ },
110
+ {
111
+ "key": "COMPLETE",
112
+ "name": "Complete"
113
+ }
114
+ ],
115
+ "transitions": [
116
+ {
117
+ "from": "ready",
118
+ "to": "ready",
119
+ "event": "INIT",
120
+ "effects": [
121
+ [
122
+ "render-ui",
123
+ "main",
124
+ {
125
+ "direction": "vertical",
126
+ "align": "stretch",
127
+ "children": [
128
+ {
129
+ "gap": "md",
130
+ "children": [
131
+ {
132
+ "type": "icon",
133
+ "name": "brain"
134
+ },
135
+ {
136
+ "variant": "h2",
137
+ "type": "typography",
138
+ "content": "LLM Completion"
139
+ }
140
+ ],
141
+ "direction": "horizontal",
142
+ "align": "center",
143
+ "type": "stack"
144
+ },
145
+ {
146
+ "type": "divider"
147
+ },
148
+ {
149
+ "type": "stack",
150
+ "direction": "vertical",
151
+ "gap": "md",
152
+ "children": [
153
+ {
154
+ "type": "select",
155
+ "options": [
156
+ {
157
+ "label": "OpenAI",
158
+ "value": "openai"
159
+ },
160
+ {
161
+ "value": "anthropic",
162
+ "label": "Anthropic"
163
+ },
164
+ {
165
+ "value": "google",
166
+ "label": "Google"
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "type": "select",
172
+ "options": [
173
+ {
174
+ "label": "GPT-4",
175
+ "value": "gpt-4"
176
+ },
177
+ {
178
+ "label": "GPT-4 Turbo",
179
+ "value": "gpt-4-turbo"
180
+ },
181
+ {
182
+ "value": "claude-3-5-sonnet",
183
+ "label": "Claude 3.5 Sonnet"
184
+ },
185
+ {
186
+ "label": "Gemini Pro",
187
+ "value": "gemini-pro"
188
+ }
189
+ ]
190
+ },
191
+ {
192
+ "placeholder": "Enter your prompt...",
193
+ "type": "textarea"
194
+ },
195
+ {
196
+ "type": "stack",
197
+ "direction": "horizontal",
198
+ "gap": "md",
199
+ "children": [
200
+ {
201
+ "type": "input",
202
+ "placeholder": "Temperature (0.0 - 2.0)",
203
+ "inputType": "number"
204
+ },
205
+ {
206
+ "placeholder": "Max tokens",
207
+ "type": "input",
208
+ "inputType": "number"
209
+ }
210
+ ]
211
+ }
212
+ ]
213
+ },
214
+ {
215
+ "variant": "primary",
216
+ "type": "button",
217
+ "label": "Complete",
218
+ "action": "COMPLETE",
219
+ "icon": "sparkles"
220
+ }
221
+ ],
222
+ "type": "stack",
223
+ "gap": "lg"
224
+ }
225
+ ]
226
+ ]
227
+ }
228
+ ]
229
+ },
230
+ "scope": "instance"
231
+ },
67
232
  {
68
233
  "name": "ServiceLlmLlm",
69
234
  "category": "interaction",
@@ -90,12 +255,16 @@
90
255
  ]
91
256
  },
92
257
  {
93
- "event": "ServiceLlmLlmCompleted",
258
+ "event": "LlmCompleted",
94
259
  "scope": "external",
95
260
  "payloadSchema": [
96
261
  {
97
- "name": "result",
98
- "type": "object"
262
+ "name": "id",
263
+ "type": "string"
264
+ },
265
+ {
266
+ "name": "content",
267
+ "type": "string"
99
268
  }
100
269
  ]
101
270
  },
@@ -112,6 +281,26 @@
112
281
  "type": "string"
113
282
  }
114
283
  ]
284
+ },
285
+ {
286
+ "event": "FAILED",
287
+ "payloadSchema": [
288
+ {
289
+ "name": "error",
290
+ "type": "string",
291
+ "required": true
292
+ }
293
+ ]
294
+ }
295
+ ],
296
+ "listens": [
297
+ {
298
+ "event": "COMPLETE",
299
+ "triggers": "COMPLETE",
300
+ "source": {
301
+ "kind": "trait",
302
+ "trait": "ServiceLlmDefaultForm"
303
+ }
115
304
  }
116
305
  ],
117
306
  "stateMachine": {
@@ -136,113 +325,57 @@
136
325
  "name": "Initialize"
137
326
  },
138
327
  {
139
- "key": "GENERATE",
140
- "name": "Generate"
141
- },
142
- {
143
- "key": "CLASSIFY",
144
- "name": "Classify"
145
- },
146
- {
147
- "key": "SUMMARIZE",
148
- "name": "Summarize"
328
+ "key": "COMPLETE",
329
+ "name": "Complete"
149
330
  },
150
331
  {
151
- "key": "COMPLETE",
152
- "name": "Complete",
332
+ "key": "ServiceLlmLoaded",
333
+ "name": "ServiceLlm loaded",
153
334
  "payloadSchema": [
154
335
  {
155
- "name": "content",
156
- "type": "string",
157
- "required": true
336
+ "name": "id",
337
+ "type": "string"
158
338
  }
159
339
  ]
160
340
  },
161
341
  {
162
- "key": "FAILED",
163
- "name": "Failed",
342
+ "key": "ServiceLlmLoadFailed",
343
+ "name": "ServiceLlm load failed",
164
344
  "payloadSchema": [
165
345
  {
166
- "name": "error",
167
- "type": "string",
168
- "required": true
346
+ "name": "message",
347
+ "type": "string"
169
348
  }
170
349
  ]
171
350
  },
172
351
  {
173
- "key": "RESET",
174
- "name": "Reset"
175
- },
176
- {
177
- "key": "RETRY",
178
- "name": "Retry"
179
- },
180
- {
181
- "key": "ServiceLlmLoaded",
182
- "name": "ServiceLlm loaded",
352
+ "key": "LlmCompleted",
353
+ "name": "Llm completed",
183
354
  "payloadSchema": [
184
355
  {
185
356
  "name": "id",
186
- "type": "string",
187
- "required": true
188
- },
189
- {
190
- "name": "inputText",
191
- "type": "string"
192
- },
193
- {
194
- "name": "action",
195
357
  "type": "string"
196
358
  },
197
359
  {
198
- "name": "result",
199
- "type": "string"
200
- },
201
- {
202
- "name": "llmStatus",
203
- "type": "string"
204
- },
205
- {
206
- "name": "error",
207
- "type": "string"
208
- },
209
- {
210
- "name": "name",
211
- "type": "string"
212
- },
213
- {
214
- "name": "description",
215
- "type": "string"
216
- },
217
- {
218
- "name": "status",
219
- "type": "string"
220
- },
221
- {
222
- "name": "createdAt",
360
+ "name": "content",
223
361
  "type": "string"
224
362
  }
225
363
  ]
226
364
  },
227
365
  {
228
- "key": "ServiceLlmLoadFailed",
229
- "name": "ServiceLlm load failed",
366
+ "key": "FAILED",
367
+ "name": "Failed",
230
368
  "payloadSchema": [
231
369
  {
232
- "name": "message",
233
- "type": "string"
370
+ "name": "error",
371
+ "type": "string",
372
+ "required": true
234
373
  }
235
374
  ]
236
375
  },
237
376
  {
238
- "key": "ServiceLlmLlmCompleted",
239
- "name": "ServiceLlm llm completed",
240
- "payloadSchema": [
241
- {
242
- "name": "result",
243
- "type": "object"
244
- }
245
- ]
377
+ "key": "RESET",
378
+ "name": "Reset"
246
379
  },
247
380
  {
248
381
  "key": "ServiceLlmLlmFailed",
@@ -257,6 +390,10 @@
257
390
  "type": "string"
258
391
  }
259
392
  ]
393
+ },
394
+ {
395
+ "key": "RETRY",
396
+ "name": "Retry"
260
397
  }
261
398
  ],
262
399
  "transitions": [
@@ -267,8 +404,28 @@
267
404
  "effects": [
268
405
  [
269
406
  "set",
270
- "@entity.inputText",
271
- ""
407
+ "@entity.provider",
408
+ "@config.provider"
409
+ ],
410
+ [
411
+ "set",
412
+ "@entity.model",
413
+ "@config.model"
414
+ ],
415
+ [
416
+ "set",
417
+ "@entity.prompt",
418
+ "@config.prompt"
419
+ ],
420
+ [
421
+ "set",
422
+ "@entity.temperature",
423
+ "@config.temperature"
424
+ ],
425
+ [
426
+ "set",
427
+ "@entity.maxTokens",
428
+ "@config.maxTokens"
272
429
  ],
273
430
  [
274
431
  "fetch",
@@ -284,65 +441,12 @@
284
441
  "render-ui",
285
442
  "main",
286
443
  {
287
- "children": [
288
- {
289
- "gap": "md",
290
- "type": "stack",
291
- "align": "center",
292
- "children": [
293
- {
294
- "type": "icon",
295
- "name": "brain"
296
- },
297
- {
298
- "variant": "h2",
299
- "content": "ServiceLlm LLM",
300
- "type": "typography"
301
- }
302
- ],
303
- "direction": "horizontal"
304
- },
305
- {
306
- "type": "divider"
307
- },
308
- {
309
- "placeholder": "Enter text for LLM processing...",
310
- "type": "textarea"
311
- },
312
- {
313
- "type": "stack",
314
- "direction": "horizontal",
315
- "children": [
316
- {
317
- "type": "button",
318
- "icon": "sparkles",
319
- "action": "GENERATE",
320
- "variant": "primary",
321
- "label": "Generate"
322
- },
323
- {
324
- "icon": "tag",
325
- "action": "CLASSIFY",
326
- "label": "Classify",
327
- "type": "button",
328
- "variant": "secondary"
329
- },
330
- {
331
- "action": "SUMMARIZE",
332
- "variant": "secondary",
333
- "label": "Summarize",
334
- "type": "button",
335
- "icon": "align-left"
336
- }
337
- ],
338
- "gap": "sm",
339
- "justify": "center"
340
- }
341
- ],
342
- "gap": "lg",
343
- "align": "stretch",
444
+ "gap": "md",
344
445
  "type": "stack",
345
- "direction": "vertical"
446
+ "direction": "vertical",
447
+ "children": [
448
+ "@config.uiTrait"
449
+ ]
346
450
  }
347
451
  ]
348
452
  ]
@@ -350,19 +454,14 @@
350
454
  {
351
455
  "from": "idle",
352
456
  "to": "processing",
353
- "event": "GENERATE",
457
+ "event": "COMPLETE",
354
458
  "effects": [
355
- [
356
- "set",
357
- "@entity.action",
358
- "generate"
359
- ],
360
459
  [
361
460
  "render-ui",
362
461
  "main",
363
462
  {
364
- "title": "Processing...",
365
- "message": "Running servicellm LLM task...",
463
+ "title": "Generating...",
464
+ "message": "Calling LLM provider.",
366
465
  "type": "loading-state"
367
466
  }
368
467
  ],
@@ -371,12 +470,15 @@
371
470
  "llm",
372
471
  "generate",
373
472
  {
374
- "userPrompt": "@entity.inputText"
473
+ "userPrompt": "@config.prompt",
474
+ "temperature": "@config.temperature",
475
+ "maxTokens": "@config.maxTokens",
476
+ "model": "@config.model"
375
477
  },
376
478
  {
377
479
  "emit": {
378
- "success": "ServiceLlmLlmCompleted",
379
- "failure": "ServiceLlmLlmFailed"
480
+ "failure": "FAILED",
481
+ "success": "LlmCompleted"
380
482
  }
381
483
  }
382
484
  ]
@@ -384,83 +486,18 @@
384
486
  },
385
487
  {
386
488
  "from": "idle",
387
- "to": "processing",
388
- "event": "CLASSIFY",
389
- "effects": [
390
- [
391
- "set",
392
- "@entity.action",
393
- "classify"
394
- ],
395
- [
396
- "render-ui",
397
- "main",
398
- {
399
- "title": "Processing...",
400
- "message": "Running servicellm LLM task...",
401
- "type": "loading-state"
402
- }
403
- ],
404
- [
405
- "call-service",
406
- "llm",
407
- "classify",
408
- {
409
- "categories": [
410
- "positive",
411
- "negative",
412
- "neutral"
413
- ],
414
- "text": "@entity.inputText"
415
- },
416
- {
417
- "emit": {
418
- "success": "ServiceLlmLlmCompleted",
419
- "failure": "ServiceLlmLlmFailed"
420
- }
421
- }
422
- ]
423
- ]
489
+ "to": "idle",
490
+ "event": "ServiceLlmLoaded"
424
491
  },
425
492
  {
426
493
  "from": "idle",
427
- "to": "processing",
428
- "event": "SUMMARIZE",
429
- "effects": [
430
- [
431
- "set",
432
- "@entity.action",
433
- "summarize"
434
- ],
435
- [
436
- "render-ui",
437
- "main",
438
- {
439
- "type": "loading-state",
440
- "message": "Running servicellm LLM task...",
441
- "title": "Processing..."
442
- }
443
- ],
444
- [
445
- "call-service",
446
- "llm",
447
- "summarize",
448
- {
449
- "text": "@entity.inputText"
450
- },
451
- {
452
- "emit": {
453
- "success": "ServiceLlmLlmCompleted",
454
- "failure": "ServiceLlmLlmFailed"
455
- }
456
- }
457
- ]
458
- ]
494
+ "to": "idle",
495
+ "event": "ServiceLlmLoadFailed"
459
496
  },
460
497
  {
461
498
  "from": "processing",
462
499
  "to": "complete",
463
- "event": "COMPLETE",
500
+ "event": "LlmCompleted",
464
501
  "effects": [
465
502
  [
466
503
  "set",
@@ -478,31 +515,31 @@
478
515
  {
479
516
  "children": [
480
517
  {
481
- "type": "icon",
482
- "name": "check-circle"
518
+ "name": "check-circle",
519
+ "type": "icon"
483
520
  },
484
521
  {
485
522
  "variant": "success",
486
523
  "type": "alert",
487
- "message": "LLM task complete"
524
+ "message": "LLM completion ready"
488
525
  },
489
526
  {
490
- "content": "@entity.result",
491
527
  "variant": "body",
528
+ "content": "@entity.result",
492
529
  "type": "typography"
493
530
  },
494
531
  {
532
+ "icon": "rotate-ccw",
495
533
  "variant": "ghost",
496
534
  "type": "button",
497
535
  "action": "RESET",
498
- "icon": "rotate-ccw",
499
536
  "label": "Start Over"
500
537
  }
501
538
  ],
502
- "type": "stack",
539
+ "direction": "vertical",
503
540
  "gap": "lg",
504
541
  "align": "center",
505
- "direction": "vertical"
542
+ "type": "stack"
506
543
  }
507
544
  ]
508
545
  ]
@@ -522,44 +559,22 @@
522
559
  "@entity.llmStatus",
523
560
  "error"
524
561
  ],
562
+ [
563
+ "emit",
564
+ "ServiceLlmLlmFailed",
565
+ {
566
+ "error": "@entity.error",
567
+ "code": "llm_complete_failed"
568
+ }
569
+ ],
525
570
  [
526
571
  "render-ui",
527
572
  "main",
528
573
  {
529
- "children": [
530
- {
531
- "onRetry": "RETRY",
532
- "title": "LLM Failed",
533
- "type": "error-state",
534
- "message": "@entity.error"
535
- },
536
- {
537
- "type": "stack",
538
- "direction": "horizontal",
539
- "children": [
540
- {
541
- "label": "Retry",
542
- "variant": "primary",
543
- "type": "button",
544
- "icon": "refresh-cw",
545
- "action": "RETRY"
546
- },
547
- {
548
- "type": "button",
549
- "variant": "ghost",
550
- "label": "Reset",
551
- "icon": "rotate-ccw",
552
- "action": "RESET"
553
- }
554
- ],
555
- "justify": "center",
556
- "gap": "sm"
557
- }
558
- ],
559
- "type": "stack",
560
- "direction": "vertical",
561
- "gap": "lg",
562
- "align": "center"
574
+ "type": "error-state",
575
+ "title": "LLM Failed",
576
+ "message": "@entity.error",
577
+ "onRetry": "RETRY"
563
578
  }
564
579
  ]
565
580
  ]
@@ -578,69 +593,26 @@
578
593
  "render-ui",
579
594
  "main",
580
595
  {
596
+ "gap": "md",
597
+ "type": "stack",
581
598
  "children": [
582
- {
583
- "gap": "md",
584
- "type": "stack",
585
- "align": "center",
586
- "direction": "horizontal",
587
- "children": [
588
- {
589
- "type": "icon",
590
- "name": "brain"
591
- },
592
- {
593
- "content": "ServiceLlm LLM",
594
- "variant": "h2",
595
- "type": "typography"
596
- }
597
- ]
598
- },
599
- {
600
- "type": "divider"
601
- },
602
- {
603
- "placeholder": "Enter text for LLM processing...",
604
- "type": "textarea"
605
- },
606
- {
607
- "children": [
608
- {
609
- "type": "button",
610
- "icon": "sparkles",
611
- "variant": "primary",
612
- "action": "GENERATE",
613
- "label": "Generate"
614
- },
615
- {
616
- "label": "Classify",
617
- "action": "CLASSIFY",
618
- "type": "button",
619
- "icon": "tag",
620
- "variant": "secondary"
621
- },
622
- {
623
- "type": "button",
624
- "icon": "align-left",
625
- "action": "SUMMARIZE",
626
- "label": "Summarize",
627
- "variant": "secondary"
628
- }
629
- ],
630
- "gap": "sm",
631
- "type": "stack",
632
- "direction": "horizontal",
633
- "justify": "center"
634
- }
599
+ "@config.uiTrait"
635
600
  ],
636
- "type": "stack",
637
- "align": "stretch",
638
- "gap": "lg",
639
601
  "direction": "vertical"
640
602
  }
641
603
  ]
642
604
  ]
643
605
  },
606
+ {
607
+ "from": "complete",
608
+ "to": "complete",
609
+ "event": "LlmCompleted"
610
+ },
611
+ {
612
+ "from": "error",
613
+ "to": "error",
614
+ "event": "ServiceLlmLlmFailed"
615
+ },
644
616
  {
645
617
  "from": "error",
646
618
  "to": "idle",
@@ -655,65 +627,12 @@
655
627
  "render-ui",
656
628
  "main",
657
629
  {
658
- "align": "stretch",
659
- "direction": "vertical",
630
+ "type": "stack",
660
631
  "children": [
661
- {
662
- "align": "center",
663
- "gap": "md",
664
- "children": [
665
- {
666
- "name": "brain",
667
- "type": "icon"
668
- },
669
- {
670
- "content": "ServiceLlm LLM",
671
- "type": "typography",
672
- "variant": "h2"
673
- }
674
- ],
675
- "type": "stack",
676
- "direction": "horizontal"
677
- },
678
- {
679
- "type": "divider"
680
- },
681
- {
682
- "type": "textarea",
683
- "placeholder": "Enter text for LLM processing..."
684
- },
685
- {
686
- "type": "stack",
687
- "justify": "center",
688
- "children": [
689
- {
690
- "action": "GENERATE",
691
- "label": "Generate",
692
- "variant": "primary",
693
- "type": "button",
694
- "icon": "sparkles"
695
- },
696
- {
697
- "label": "Classify",
698
- "type": "button",
699
- "action": "CLASSIFY",
700
- "variant": "secondary",
701
- "icon": "tag"
702
- },
703
- {
704
- "label": "Summarize",
705
- "variant": "secondary",
706
- "action": "SUMMARIZE",
707
- "icon": "align-left",
708
- "type": "button"
709
- }
710
- ],
711
- "gap": "sm",
712
- "direction": "horizontal"
713
- }
632
+ "@config.uiTrait"
714
633
  ],
715
- "gap": "lg",
716
- "type": "stack"
634
+ "gap": "md",
635
+ "direction": "vertical"
717
636
  }
718
637
  ]
719
638
  ]
@@ -732,71 +651,44 @@
732
651
  "render-ui",
733
652
  "main",
734
653
  {
735
- "gap": "lg",
736
654
  "type": "stack",
737
- "children": [
738
- {
739
- "align": "center",
740
- "children": [
741
- {
742
- "name": "brain",
743
- "type": "icon"
744
- },
745
- {
746
- "type": "typography",
747
- "variant": "h2",
748
- "content": "ServiceLlm LLM"
749
- }
750
- ],
751
- "type": "stack",
752
- "direction": "horizontal",
753
- "gap": "md"
754
- },
755
- {
756
- "type": "divider"
757
- },
758
- {
759
- "type": "textarea",
760
- "placeholder": "Enter text for LLM processing..."
761
- },
762
- {
763
- "justify": "center",
764
- "gap": "sm",
765
- "children": [
766
- {
767
- "icon": "sparkles",
768
- "label": "Generate",
769
- "action": "GENERATE",
770
- "variant": "primary",
771
- "type": "button"
772
- },
773
- {
774
- "action": "CLASSIFY",
775
- "type": "button",
776
- "variant": "secondary",
777
- "icon": "tag",
778
- "label": "Classify"
779
- },
780
- {
781
- "action": "SUMMARIZE",
782
- "variant": "secondary",
783
- "label": "Summarize",
784
- "type": "button",
785
- "icon": "align-left"
786
- }
787
- ],
788
- "type": "stack",
789
- "direction": "horizontal"
790
- }
791
- ],
655
+ "gap": "md",
792
656
  "direction": "vertical",
793
- "align": "stretch"
657
+ "children": [
658
+ "@config.uiTrait"
659
+ ]
794
660
  }
795
661
  ]
796
662
  ]
797
663
  }
798
664
  ]
799
665
  },
666
+ "config": {
667
+ "provider": {
668
+ "type": "string",
669
+ "default": "openai"
670
+ },
671
+ "uiTrait": {
672
+ "type": "trait",
673
+ "default": "@trait.ServiceLlmDefaultForm"
674
+ },
675
+ "model": {
676
+ "type": "string",
677
+ "default": "gpt-4"
678
+ },
679
+ "maxTokens": {
680
+ "type": "number",
681
+ "default": 2048.0
682
+ },
683
+ "prompt": {
684
+ "type": "string",
685
+ "default": ""
686
+ },
687
+ "temperature": {
688
+ "type": "number",
689
+ "default": 0.7
690
+ }
691
+ },
800
692
  "scope": "instance"
801
693
  }
802
694
  ],