robot_lab 0.0.1 → 0.0.4

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/deploy-github-pages.yml +9 -9
  3. data/.irbrc +6 -0
  4. data/CHANGELOG.md +90 -0
  5. data/README.md +203 -46
  6. data/Rakefile +70 -1
  7. data/docs/api/core/index.md +12 -0
  8. data/docs/api/core/robot.md +478 -130
  9. data/docs/api/core/tool.md +205 -209
  10. data/docs/api/history/active-record-adapter.md +174 -94
  11. data/docs/api/history/config.md +186 -93
  12. data/docs/api/history/index.md +57 -61
  13. data/docs/api/history/thread-manager.md +123 -73
  14. data/docs/api/mcp/client.md +119 -48
  15. data/docs/api/mcp/index.md +75 -60
  16. data/docs/api/mcp/server.md +120 -136
  17. data/docs/api/mcp/transports.md +172 -184
  18. data/docs/api/streaming/context.md +157 -74
  19. data/docs/api/streaming/events.md +114 -166
  20. data/docs/api/streaming/index.md +74 -72
  21. data/docs/architecture/core-concepts.md +361 -112
  22. data/docs/architecture/index.md +97 -59
  23. data/docs/architecture/message-flow.md +138 -129
  24. data/docs/architecture/network-orchestration.md +197 -50
  25. data/docs/architecture/robot-execution.md +199 -146
  26. data/docs/architecture/state-management.md +255 -187
  27. data/docs/concepts.md +312 -48
  28. data/docs/examples/basic-chat.md +89 -77
  29. data/docs/examples/index.md +222 -47
  30. data/docs/examples/mcp-server.md +207 -203
  31. data/docs/examples/multi-robot-network.md +129 -35
  32. data/docs/examples/rails-application.md +159 -160
  33. data/docs/examples/tool-usage.md +295 -204
  34. data/docs/getting-started/configuration.md +275 -162
  35. data/docs/getting-started/index.md +1 -1
  36. data/docs/getting-started/installation.md +22 -13
  37. data/docs/getting-started/quick-start.md +166 -121
  38. data/docs/guides/building-robots.md +417 -212
  39. data/docs/guides/creating-networks.md +94 -24
  40. data/docs/guides/mcp-integration.md +152 -113
  41. data/docs/guides/memory.md +220 -164
  42. data/docs/guides/streaming.md +80 -110
  43. data/docs/guides/using-tools.md +259 -212
  44. data/docs/index.md +50 -37
  45. data/examples/01_simple_robot.rb +6 -9
  46. data/examples/02_tools.rb +6 -9
  47. data/examples/03_network.rb +13 -14
  48. data/examples/04_mcp.rb +5 -8
  49. data/examples/05_streaming.rb +5 -8
  50. data/examples/06_prompt_templates.rb +42 -37
  51. data/examples/07_network_memory.rb +13 -14
  52. data/examples/08_llm_config.rb +140 -0
  53. data/examples/09_chaining.rb +223 -0
  54. data/examples/10_memory.rb +331 -0
  55. data/examples/11_network_introspection.rb +230 -0
  56. data/examples/12_message_bus.rb +74 -0
  57. data/examples/13_spawn.rb +90 -0
  58. data/examples/14_rusty_circuit/comic.rb +143 -0
  59. data/examples/14_rusty_circuit/display.rb +203 -0
  60. data/examples/14_rusty_circuit/heckler.rb +57 -0
  61. data/examples/14_rusty_circuit/open_mic.rb +121 -0
  62. data/examples/14_rusty_circuit/prompts/open_mic_comic.md +20 -0
  63. data/examples/14_rusty_circuit/prompts/open_mic_heckler.md +23 -0
  64. data/examples/14_rusty_circuit/prompts/open_mic_scout.md +20 -0
  65. data/examples/14_rusty_circuit/scout.rb +173 -0
  66. data/examples/14_rusty_circuit/scout_notes.md +89 -0
  67. data/examples/14_rusty_circuit/show.log +234 -0
  68. data/examples/15_memory_network_and_bus/editor_in_chief.rb +24 -0
  69. data/examples/15_memory_network_and_bus/editorial_pipeline.rb +206 -0
  70. data/examples/15_memory_network_and_bus/linux_writer.rb +80 -0
  71. data/examples/15_memory_network_and_bus/os_editor.rb +46 -0
  72. data/examples/15_memory_network_and_bus/os_writer.rb +46 -0
  73. data/examples/15_memory_network_and_bus/output/combined_article.md +13 -0
  74. data/examples/15_memory_network_and_bus/output/final_article.md +15 -0
  75. data/examples/15_memory_network_and_bus/output/linux_draft.md +5 -0
  76. data/examples/15_memory_network_and_bus/output/mac_draft.md +7 -0
  77. data/examples/15_memory_network_and_bus/output/memory.json +13 -0
  78. data/examples/15_memory_network_and_bus/output/revision_1.md +19 -0
  79. data/examples/15_memory_network_and_bus/output/revision_2.md +15 -0
  80. data/examples/15_memory_network_and_bus/output/windows_draft.md +7 -0
  81. data/examples/15_memory_network_and_bus/prompts/os_advocate.md +13 -0
  82. data/examples/15_memory_network_and_bus/prompts/os_chief.md +13 -0
  83. data/examples/15_memory_network_and_bus/prompts/os_editor.md +13 -0
  84. data/examples/README.md +197 -0
  85. data/examples/prompts/{assistant/system.txt.erb → assistant.md} +3 -0
  86. data/examples/prompts/{billing/system.txt.erb → billing.md} +3 -0
  87. data/examples/prompts/{classifier/system.txt.erb → classifier.md} +3 -0
  88. data/examples/prompts/comedian.md +6 -0
  89. data/examples/prompts/comedy_critic.md +10 -0
  90. data/examples/prompts/configurable.md +9 -0
  91. data/examples/prompts/dispatcher.md +12 -0
  92. data/examples/prompts/{entity_extractor/system.txt.erb → entity_extractor.md} +3 -0
  93. data/examples/prompts/{escalation/system.txt.erb → escalation.md} +7 -0
  94. data/examples/prompts/frontmatter_mcp_test.md +9 -0
  95. data/examples/prompts/frontmatter_named_test.md +5 -0
  96. data/examples/prompts/frontmatter_tools_test.md +6 -0
  97. data/examples/prompts/{general/system.txt.erb → general.md} +3 -0
  98. data/examples/prompts/{github_assistant/system.txt.erb → github_assistant.md} +8 -0
  99. data/examples/prompts/{helper/system.txt.erb → helper.md} +3 -0
  100. data/examples/prompts/{keyword_extractor/system.txt.erb → keyword_extractor.md} +3 -0
  101. data/examples/prompts/llm_config_demo.md +20 -0
  102. data/examples/prompts/{order_support/system.txt.erb → order_support.md} +8 -0
  103. data/examples/prompts/os_advocate.md +13 -0
  104. data/examples/prompts/os_chief.md +13 -0
  105. data/examples/prompts/os_editor.md +13 -0
  106. data/examples/prompts/{product_support/system.txt.erb → product_support.md} +7 -0
  107. data/examples/prompts/{sentiment_analyzer/system.txt.erb → sentiment_analyzer.md} +3 -0
  108. data/examples/prompts/{synthesizer/system.txt.erb → synthesizer.md} +3 -0
  109. data/examples/prompts/{technical/system.txt.erb → technical.md} +3 -0
  110. data/examples/prompts/{triage/system.txt.erb → triage.md} +6 -0
  111. data/lib/generators/robot_lab/templates/initializer.rb.tt +1 -1
  112. data/lib/robot_lab/adapters/openai.rb +2 -1
  113. data/lib/robot_lab/ask_user.rb +75 -0
  114. data/lib/robot_lab/config/defaults.yml +121 -0
  115. data/lib/robot_lab/config.rb +183 -0
  116. data/lib/robot_lab/error.rb +6 -0
  117. data/lib/robot_lab/mcp/client.rb +1 -1
  118. data/lib/robot_lab/memory.rb +2 -2
  119. data/lib/robot_lab/robot.rb +523 -249
  120. data/lib/robot_lab/robot_message.rb +44 -0
  121. data/lib/robot_lab/robot_result.rb +1 -0
  122. data/lib/robot_lab/robotic_model.rb +1 -1
  123. data/lib/robot_lab/streaming/context.rb +1 -1
  124. data/lib/robot_lab/tool.rb +108 -172
  125. data/lib/robot_lab/tool_config.rb +1 -1
  126. data/lib/robot_lab/tool_manifest.rb +2 -18
  127. data/lib/robot_lab/version.rb +1 -1
  128. data/lib/robot_lab.rb +66 -55
  129. metadata +107 -116
  130. data/examples/prompts/assistant/user.txt.erb +0 -1
  131. data/examples/prompts/billing/user.txt.erb +0 -1
  132. data/examples/prompts/classifier/user.txt.erb +0 -1
  133. data/examples/prompts/entity_extractor/user.txt.erb +0 -3
  134. data/examples/prompts/escalation/user.txt.erb +0 -34
  135. data/examples/prompts/general/user.txt.erb +0 -1
  136. data/examples/prompts/github_assistant/user.txt.erb +0 -1
  137. data/examples/prompts/helper/user.txt.erb +0 -1
  138. data/examples/prompts/keyword_extractor/user.txt.erb +0 -3
  139. data/examples/prompts/order_support/user.txt.erb +0 -22
  140. data/examples/prompts/product_support/user.txt.erb +0 -32
  141. data/examples/prompts/sentiment_analyzer/user.txt.erb +0 -3
  142. data/examples/prompts/synthesizer/user.txt.erb +0 -15
  143. data/examples/prompts/technical/user.txt.erb +0 -1
  144. data/examples/prompts/triage/user.txt.erb +0 -17
  145. data/lib/robot_lab/configuration.rb +0 -143
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robot_lab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: myway_config
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.1'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: zeitwerk
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -23,20 +37,34 @@ dependencies:
23
37
  - - "~>"
24
38
  - !ruby/object:Gem::Version
25
39
  version: '2.6'
40
+ - !ruby/object:Gem::Dependency
41
+ name: activesupport
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '7.0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '7.0'
26
54
  - !ruby/object:Gem::Dependency
27
55
  name: ruby_llm
28
56
  requirement: !ruby/object:Gem::Requirement
29
57
  requirements:
30
58
  - - "~>"
31
59
  - !ruby/object:Gem::Version
32
- version: '1.0'
60
+ version: '1.12'
33
61
  type: :runtime
34
62
  prerelease: false
35
63
  version_requirements: !ruby/object:Gem::Requirement
36
64
  requirements:
37
65
  - - "~>"
38
66
  - !ruby/object:Gem::Version
39
- version: '1.0'
67
+ version: '1.12'
40
68
  - !ruby/object:Gem::Dependency
41
69
  name: ruby_llm-mcp
42
70
  requirement: !ruby/object:Gem::Requirement
@@ -52,19 +80,19 @@ dependencies:
52
80
  - !ruby/object:Gem::Version
53
81
  version: '0'
54
82
  - !ruby/object:Gem::Dependency
55
- name: ruby_llm-template
83
+ name: prompt_manager
56
84
  requirement: !ruby/object:Gem::Requirement
57
85
  requirements:
58
- - - ">="
86
+ - - "~>"
59
87
  - !ruby/object:Gem::Version
60
- version: '0'
88
+ version: '1.0'
61
89
  type: :runtime
62
90
  prerelease: false
63
91
  version_requirements: !ruby/object:Gem::Requirement
64
92
  requirements:
65
- - - ">="
93
+ - - "~>"
66
94
  - !ruby/object:Gem::Version
67
- version: '0'
95
+ version: '1.0'
68
96
  - !ruby/object:Gem::Dependency
69
97
  name: ruby_llm-schema
70
98
  requirement: !ruby/object:Gem::Requirement
@@ -122,21 +150,7 @@ dependencies:
122
150
  - !ruby/object:Gem::Version
123
151
  version: '2.0'
124
152
  - !ruby/object:Gem::Dependency
125
- name: simple_flow
126
- requirement: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: 0.3.0
131
- type: :runtime
132
- prerelease: false
133
- version_requirements: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: 0.3.0
138
- - !ruby/object:Gem::Dependency
139
- name: state_machines
153
+ name: typed_bus
140
154
  requirement: !ruby/object:Gem::Requirement
141
155
  requirements:
142
156
  - - ">="
@@ -150,33 +164,19 @@ dependencies:
150
164
  - !ruby/object:Gem::Version
151
165
  version: '0'
152
166
  - !ruby/object:Gem::Dependency
153
- name: state_machines-activemodel
154
- requirement: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - ">="
157
- - !ruby/object:Gem::Version
158
- version: '0'
159
- type: :runtime
160
- prerelease: false
161
- version_requirements: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: '0'
166
- - !ruby/object:Gem::Dependency
167
- name: state_machines-activerecord
167
+ name: simple_flow
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
- - - ">="
170
+ - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '0'
172
+ version: 0.3.0
173
173
  type: :runtime
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - ">="
177
+ - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '0'
179
+ version: 0.3.0
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: async-http
182
182
  requirement: !ruby/object:Gem::Requirement
@@ -205,48 +205,6 @@ dependencies:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0.30'
208
- - !ruby/object:Gem::Dependency
209
- name: railties
210
- requirement: !ruby/object:Gem::Requirement
211
- requirements:
212
- - - ">="
213
- - !ruby/object:Gem::Version
214
- version: '7.0'
215
- type: :runtime
216
- prerelease: false
217
- version_requirements: !ruby/object:Gem::Requirement
218
- requirements:
219
- - - ">="
220
- - !ruby/object:Gem::Version
221
- version: '7.0'
222
- - !ruby/object:Gem::Dependency
223
- name: activerecord
224
- requirement: !ruby/object:Gem::Requirement
225
- requirements:
226
- - - ">="
227
- - !ruby/object:Gem::Version
228
- version: '7.0'
229
- type: :runtime
230
- prerelease: false
231
- version_requirements: !ruby/object:Gem::Requirement
232
- requirements:
233
- - - ">="
234
- - !ruby/object:Gem::Version
235
- version: '7.0'
236
- - !ruby/object:Gem::Dependency
237
- name: activesupport
238
- requirement: !ruby/object:Gem::Requirement
239
- requirements:
240
- - - ">="
241
- - !ruby/object:Gem::Version
242
- version: '7.0'
243
- type: :runtime
244
- prerelease: false
245
- version_requirements: !ruby/object:Gem::Requirement
246
- requirements:
247
- - - ">="
248
- - !ruby/object:Gem::Version
249
- version: '7.0'
250
208
  description: |
251
209
  RobotLab is a Ruby framework for building and orchestrating multi-robot LLM workflows.
252
210
  Built on ruby_llm, it provides robots with template-based prompts, tools, and shared
@@ -263,6 +221,7 @@ files:
263
221
  - ".envrc"
264
222
  - ".github/workflows/deploy-github-pages.yml"
265
223
  - ".github/workflows/deploy-yard-docs.yml"
224
+ - ".irbrc"
266
225
  - CHANGELOG.md
267
226
  - COMMITS.md
268
227
  - LICENSE.txt
@@ -331,36 +290,65 @@ files:
331
290
  - examples/05_streaming.rb
332
291
  - examples/06_prompt_templates.rb
333
292
  - examples/07_network_memory.rb
334
- - examples/prompts/assistant/system.txt.erb
335
- - examples/prompts/assistant/user.txt.erb
336
- - examples/prompts/billing/system.txt.erb
337
- - examples/prompts/billing/user.txt.erb
338
- - examples/prompts/classifier/system.txt.erb
339
- - examples/prompts/classifier/user.txt.erb
340
- - examples/prompts/entity_extractor/system.txt.erb
341
- - examples/prompts/entity_extractor/user.txt.erb
342
- - examples/prompts/escalation/system.txt.erb
343
- - examples/prompts/escalation/user.txt.erb
344
- - examples/prompts/general/system.txt.erb
345
- - examples/prompts/general/user.txt.erb
346
- - examples/prompts/github_assistant/system.txt.erb
347
- - examples/prompts/github_assistant/user.txt.erb
348
- - examples/prompts/helper/system.txt.erb
349
- - examples/prompts/helper/user.txt.erb
350
- - examples/prompts/keyword_extractor/system.txt.erb
351
- - examples/prompts/keyword_extractor/user.txt.erb
352
- - examples/prompts/order_support/system.txt.erb
353
- - examples/prompts/order_support/user.txt.erb
354
- - examples/prompts/product_support/system.txt.erb
355
- - examples/prompts/product_support/user.txt.erb
356
- - examples/prompts/sentiment_analyzer/system.txt.erb
357
- - examples/prompts/sentiment_analyzer/user.txt.erb
358
- - examples/prompts/synthesizer/system.txt.erb
359
- - examples/prompts/synthesizer/user.txt.erb
360
- - examples/prompts/technical/system.txt.erb
361
- - examples/prompts/technical/user.txt.erb
362
- - examples/prompts/triage/system.txt.erb
363
- - examples/prompts/triage/user.txt.erb
293
+ - examples/08_llm_config.rb
294
+ - examples/09_chaining.rb
295
+ - examples/10_memory.rb
296
+ - examples/11_network_introspection.rb
297
+ - examples/12_message_bus.rb
298
+ - examples/13_spawn.rb
299
+ - examples/14_rusty_circuit/comic.rb
300
+ - examples/14_rusty_circuit/display.rb
301
+ - examples/14_rusty_circuit/heckler.rb
302
+ - examples/14_rusty_circuit/open_mic.rb
303
+ - examples/14_rusty_circuit/prompts/open_mic_comic.md
304
+ - examples/14_rusty_circuit/prompts/open_mic_heckler.md
305
+ - examples/14_rusty_circuit/prompts/open_mic_scout.md
306
+ - examples/14_rusty_circuit/scout.rb
307
+ - examples/14_rusty_circuit/scout_notes.md
308
+ - examples/14_rusty_circuit/show.log
309
+ - examples/15_memory_network_and_bus/editor_in_chief.rb
310
+ - examples/15_memory_network_and_bus/editorial_pipeline.rb
311
+ - examples/15_memory_network_and_bus/linux_writer.rb
312
+ - examples/15_memory_network_and_bus/os_editor.rb
313
+ - examples/15_memory_network_and_bus/os_writer.rb
314
+ - examples/15_memory_network_and_bus/output/combined_article.md
315
+ - examples/15_memory_network_and_bus/output/final_article.md
316
+ - examples/15_memory_network_and_bus/output/linux_draft.md
317
+ - examples/15_memory_network_and_bus/output/mac_draft.md
318
+ - examples/15_memory_network_and_bus/output/memory.json
319
+ - examples/15_memory_network_and_bus/output/revision_1.md
320
+ - examples/15_memory_network_and_bus/output/revision_2.md
321
+ - examples/15_memory_network_and_bus/output/windows_draft.md
322
+ - examples/15_memory_network_and_bus/prompts/os_advocate.md
323
+ - examples/15_memory_network_and_bus/prompts/os_chief.md
324
+ - examples/15_memory_network_and_bus/prompts/os_editor.md
325
+ - examples/README.md
326
+ - examples/prompts/assistant.md
327
+ - examples/prompts/billing.md
328
+ - examples/prompts/classifier.md
329
+ - examples/prompts/comedian.md
330
+ - examples/prompts/comedy_critic.md
331
+ - examples/prompts/configurable.md
332
+ - examples/prompts/dispatcher.md
333
+ - examples/prompts/entity_extractor.md
334
+ - examples/prompts/escalation.md
335
+ - examples/prompts/frontmatter_mcp_test.md
336
+ - examples/prompts/frontmatter_named_test.md
337
+ - examples/prompts/frontmatter_tools_test.md
338
+ - examples/prompts/general.md
339
+ - examples/prompts/github_assistant.md
340
+ - examples/prompts/helper.md
341
+ - examples/prompts/keyword_extractor.md
342
+ - examples/prompts/llm_config_demo.md
343
+ - examples/prompts/order_support.md
344
+ - examples/prompts/os_advocate.md
345
+ - examples/prompts/os_chief.md
346
+ - examples/prompts/os_editor.md
347
+ - examples/prompts/product_support.md
348
+ - examples/prompts/sentiment_analyzer.md
349
+ - examples/prompts/synthesizer.md
350
+ - examples/prompts/technical.md
351
+ - examples/prompts/triage.md
364
352
  - lib/generators/robot_lab/install_generator.rb
365
353
  - lib/generators/robot_lab/robot_generator.rb
366
354
  - lib/generators/robot_lab/templates/initializer.rb.tt
@@ -376,7 +364,9 @@ files:
376
364
  - lib/robot_lab/adapters/gemini.rb
377
365
  - lib/robot_lab/adapters/openai.rb
378
366
  - lib/robot_lab/adapters/registry.rb
379
- - lib/robot_lab/configuration.rb
367
+ - lib/robot_lab/ask_user.rb
368
+ - lib/robot_lab/config.rb
369
+ - lib/robot_lab/config/defaults.yml
380
370
  - lib/robot_lab/error.rb
381
371
  - lib/robot_lab/errors.rb
382
372
  - lib/robot_lab/history/active_record_adapter.rb
@@ -396,6 +386,7 @@ files:
396
386
  - lib/robot_lab/rails/engine.rb
397
387
  - lib/robot_lab/rails/railtie.rb
398
388
  - lib/robot_lab/robot.rb
389
+ - lib/robot_lab/robot_message.rb
399
390
  - lib/robot_lab/robot_result.rb
400
391
  - lib/robot_lab/robotic_model.rb
401
392
  - lib/robot_lab/state_proxy.rb
@@ -436,7 +427,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
436
427
  - !ruby/object:Gem::Version
437
428
  version: '0'
438
429
  requirements: []
439
- rubygems_version: 4.0.4
430
+ rubygems_version: 4.0.6
440
431
  specification_version: 4
441
432
  summary: Ruby framework for building and orchestrating multi-robot LLM workflows
442
433
  test_files: []
@@ -1 +0,0 @@
1
- <%= message %>
@@ -1 +0,0 @@
1
- <%= message %>
@@ -1 +0,0 @@
1
- <%= message %>
@@ -1,3 +0,0 @@
1
- Extract all named entities from this text:
2
-
3
- <%= message %>
@@ -1,34 +0,0 @@
1
- Customer <%= customer[:name] %> (escalated case): <%= message %>
2
-
3
- ## Case Context
4
- <% if defined?(escalation_context) && escalation_context %>
5
- <% if escalation_context[:previous_interactions]&.any? %>
6
- ### Previous Interactions
7
- <% escalation_context[:previous_interactions].each do |interaction| %>
8
- - <%= interaction[:date] %> (<%= interaction[:channel] %>): <%= interaction[:summary] %>
9
- <% end %>
10
- <% end %>
11
-
12
- <% if escalation_context[:related_orders]&.any? %>
13
- ### Related Orders
14
- <% escalation_context[:related_orders].each do |order| %>
15
- - Order #<%= order[:id] %>: $<%= order[:total] %> - <%= order[:status] %>
16
- <% end %>
17
- <% end %>
18
-
19
- <% if escalation_context[:compensation_history]&.any? %>
20
- ### Previous Compensation
21
- <% escalation_context[:compensation_history].each do |comp| %>
22
- - <%= comp[:date] %>: <%= comp[:type] %> - $<%= comp[:amount] %> (<%= comp[:reason] %>)
23
- <% end %>
24
- <% end %>
25
-
26
- ### Escalation Reason
27
- <%= escalation_context[:escalation_reason] || "Not specified" %>
28
-
29
- ### Sentiment Analysis
30
- - Detected Sentiment: <%= escalation_context[:sentiment] || "Unknown" %>
31
- - Urgency Level: <%= escalation_context[:urgency] || "Normal" %>
32
- <% end %>
33
-
34
- Please resolve this escalated case with empathy and authority.
@@ -1 +0,0 @@
1
- <%= message %>
@@ -1 +0,0 @@
1
- <%= message %>
@@ -1 +0,0 @@
1
- <%= message %>
@@ -1,3 +0,0 @@
1
- Extract keywords and topics from this text:
2
-
3
- <%= message %>
@@ -1,22 +0,0 @@
1
- Customer <%= customer[:name] %> asks: <%= message %>
2
-
3
- ## Order History
4
- <% if orders&.any? %>
5
- <% orders.each do |order| %>
6
- ### Order #<%= order[:id] %>
7
- - Date: <%= order[:date] %>
8
- - Status: <%= order[:status] %>
9
- - Total: $<%= order[:total] %>
10
- - Items:
11
- <% order[:items].each do |item| %>
12
- - <%= item[:name] %> (x<%= item[:quantity] %>) - $<%= item[:price] %>
13
- <% end %>
14
- <% if order[:tracking] %>
15
- - Tracking: <%= order[:tracking] %>
16
- <% end %>
17
- <% end %>
18
- <% else %>
19
- No orders found for this customer.
20
- <% end %>
21
-
22
- Please help the customer with their order inquiry.
@@ -1,32 +0,0 @@
1
- Customer <%= customer[:name] %> asks: <%= message %>
2
-
3
- ## Relevant Products
4
- <% if products&.any? %>
5
- <% products.each do |product| %>
6
- ### <%= product[:name] %>
7
- - SKU: <%= product[:sku] %>
8
- - Price: $<%= product[:price] %>
9
- - Category: <%= product[:category] %>
10
- - In Stock: <%= product[:in_stock] ? "Yes (#{product[:quantity]} available)" : "No" %>
11
- <% if product[:features]&.any? %>
12
- - Features:
13
- <% product[:features].each do |feature| %>
14
- - <%= feature %>
15
- <% end %>
16
- <% end %>
17
- <% if product[:compatible_with]&.any? %>
18
- - Compatible With: <%= product[:compatible_with].join(", ") %>
19
- <% end %>
20
- <% end %>
21
- <% else %>
22
- No specific products matched the query. Provide general guidance.
23
- <% end %>
24
-
25
- <% if promotions&.any? %>
26
- ## Current Promotions
27
- <% promotions.each do |promo| %>
28
- - **<%= promo[:name] %>**: <%= promo[:description] %> (Code: <%= promo[:code] %>)
29
- <% end %>
30
- <% end %>
31
-
32
- Please help the customer with their product question.
@@ -1,3 +0,0 @@
1
- Analyze the sentiment of this text:
2
-
3
- <%= message %>
@@ -1,15 +0,0 @@
1
- Please synthesize these analysis results into a comprehensive summary:
2
-
3
- ## Original Text
4
- <%= message %>
5
-
6
- ## Sentiment Analysis
7
- <%= sentiment %>
8
-
9
- ## Entities Found
10
- <%= entities %>
11
-
12
- ## Keywords & Topics
13
- <%= keywords %>
14
-
15
- Provide a unified analysis combining all these perspectives.
@@ -1 +0,0 @@
1
- <%= message %>
@@ -1,17 +0,0 @@
1
- Customer Message: <%= message %>
2
-
3
- <% if customer && customer[:recent_orders]&.any? %>
4
- Recent Order Activity:
5
- <% customer[:recent_orders].each do |order| %>
6
- - Order #<%= order[:id] %> (<%= order[:date] %>): <%= order[:status] %> - $<%= order[:total] %>
7
- <% end %>
8
- <% end %>
9
-
10
- <% if customer && customer[:open_tickets]&.any? %>
11
- Open Support Tickets:
12
- <% customer[:open_tickets].each do |ticket| %>
13
- - Ticket #<%= ticket[:id] %>: <%= ticket[:subject] %> (<%= ticket[:status] %>)
14
- <% end %>
15
- <% end %>
16
-
17
- Please classify this request.
@@ -1,143 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RobotLab
4
- # Global configuration for RobotLab
5
- #
6
- # @example
7
- # RobotLab.configure do |config|
8
- # config.default_provider = :anthropic
9
- # config.default_model = "claude-sonnet-4"
10
- # config.template_path = "app/prompts"
11
- # config.anthropic_api_key = ENV["ANTHROPIC_API_KEY"]
12
- #
13
- # # Global MCP servers available to all networks and robots
14
- # config.mcp = [
15
- # { name: "github", transport: { type: "stdio", command: "github-mcp" } }
16
- # ]
17
- #
18
- # # Global tools whitelist (only these tools are available)
19
- # config.tools = %w[search_code create_issue]
20
- # end
21
- #
22
- class Configuration
23
- # @!attribute [rw] default_provider
24
- # @return [Symbol] the default LLM provider (defaults to :anthropic)
25
- # @!attribute [rw] default_model
26
- # @return [String] the default model to use (defaults to "claude-sonnet-4")
27
- # @!attribute [rw] max_iterations
28
- # @return [Integer] maximum robot iterations per network run (defaults to 10)
29
- # @!attribute [rw] max_tool_iterations
30
- # @return [Integer] maximum tool iterations per robot run (defaults to 10)
31
- # @!attribute [rw] streaming_enabled
32
- # @return [Boolean] whether streaming is enabled by default (defaults to true)
33
- # @!attribute [rw] logger
34
- # @return [Logger] the logger instance
35
- # @!attribute [rw] mcp
36
- # @return [Symbol, Array] global MCP server configuration (:none, :inherit, or array)
37
- # @!attribute [rw] tools
38
- # @return [Symbol, Array] global tools whitelist (:none, :inherit, or array)
39
- attr_accessor :default_provider,
40
- :default_model,
41
- :max_iterations,
42
- :max_tool_iterations,
43
- :streaming_enabled,
44
- :logger,
45
- :mcp,
46
- :tools
47
-
48
- # Creates a new Configuration with default values.
49
- def initialize
50
- @default_provider = :anthropic
51
- @default_model = "claude-sonnet-4"
52
- @max_iterations = 10
53
- @max_tool_iterations = 10
54
- @streaming_enabled = true
55
- @logger = default_logger
56
- @template_path = nil
57
- @mcp = :none
58
- @tools = :none
59
- end
60
-
61
- # Sets the Anthropic API key.
62
- #
63
- # @param key [String] the API key
64
- # @return [void]
65
- def anthropic_api_key=(key)
66
- RubyLLM.configure { |c| c.anthropic_api_key = key }
67
- end
68
-
69
- # Sets the OpenAI API key.
70
- #
71
- # @param key [String] the API key
72
- # @return [void]
73
- def openai_api_key=(key)
74
- RubyLLM.configure { |c| c.openai_api_key = key }
75
- end
76
-
77
- # Sets the Google Gemini API key.
78
- #
79
- # @param key [String] the API key
80
- # @return [void]
81
- def gemini_api_key=(key)
82
- RubyLLM.configure { |c| c.gemini_api_key = key }
83
- end
84
-
85
- # Sets the AWS Bedrock API key.
86
- #
87
- # @param key [String] the API key
88
- # @return [void]
89
- def bedrock_api_key=(key)
90
- RubyLLM.configure { |c| c.bedrock_api_key = key }
91
- end
92
-
93
- # Sets the OpenRouter API key.
94
- #
95
- # @param key [String] the API key
96
- # @return [void]
97
- def openrouter_api_key=(key)
98
- RubyLLM.configure { |c| c.openrouter_api_key = key }
99
- end
100
-
101
- # Set the template path and configure ruby_llm-template
102
- #
103
- # @param path [String] Path to the templates directory
104
- #
105
- def template_path=(path)
106
- @template_path = path
107
- configure_template_library if path
108
- end
109
-
110
- # Returns the template path.
111
- #
112
- # @return [String] the configured template path or default
113
- def template_path
114
- @template_path || default_template_path
115
- end
116
-
117
- private
118
-
119
- def configure_template_library
120
- require "ruby_llm/template"
121
- RubyLLM::Template.configure do |config|
122
- config.template_directory = @template_path
123
- end
124
- end
125
-
126
- def default_template_path
127
- if defined?(Rails) && Rails.root
128
- Rails.root.join("app", "prompts").to_s
129
- else
130
- "prompts"
131
- end
132
- end
133
-
134
- def default_logger
135
- if defined?(Rails) && Rails.respond_to?(:logger)
136
- Rails.logger
137
- else
138
- require "logger"
139
- Logger.new($stdout, level: Logger::INFO)
140
- end
141
- end
142
- end
143
- end