luo 0.1.25 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -4
  3. data/exe/luo +2 -3
  4. data/lib/luo/cli/init_app.rb +17 -0
  5. data/lib/luo/cli/init_base.rb +45 -0
  6. data/lib/luo/cli/init_notebook.rb +20 -0
  7. data/lib/luo/cli.rb +33 -49
  8. data/lib/luo/helpers.rb +54 -0
  9. data/lib/luo/{init_project.rb → init_project._rb} +1 -1
  10. data/lib/luo/marqo.rb +1 -1
  11. data/lib/luo/open_ai_agent_runner.rb +15 -4
  12. data/lib/luo/parser_markdown.rb +34 -0
  13. data/lib/luo/project_init.rb +9 -0
  14. data/lib/luo/prompt_template.rb +7 -3
  15. data/lib/luo/prompts.rb +30 -2
  16. data/lib/luo/version.rb +1 -1
  17. data/lib/luo/xinghuo.rb +9 -8
  18. data/lib/luo/xinghuo_agent_runner.rb +7 -3
  19. data/lib/luo.rb +24 -2
  20. data/luo.gemspec +4 -1
  21. data/sig/luo/prompt_template.rbs +1 -1
  22. data/templates/AppGemfile +3 -0
  23. data/templates/NoteBookGemfile +5 -0
  24. data/{lib/luo/projects → templates}/application.rb +5 -1
  25. data/templates/luo.ipynb +292 -0
  26. data/templates/prompts/luo_error.md.erb +8 -0
  27. metadata +70 -46
  28. data/.idea/.gitignore +0 -8
  29. data/.idea/dictionaries/mj.xml +0 -7
  30. data/.idea/inspectionProfiles/Project_Default.xml +0 -9
  31. data/.idea/luo.iml +0 -81
  32. data/.idea/misc.xml +0 -4
  33. data/.idea/modules.xml +0 -8
  34. data/.idea/vcs.xml +0 -6
  35. data/init.rb +0 -16
  36. data/lib/luo/projects/luo.ipynb +0 -167
  37. data/lib/luo/templates/agent_input.md.erb +0 -39
  38. data/lib/luo/templates/agent_system.md.erb +0 -4
  39. data/lib/luo/templates/agent_tool_input.md.erb +0 -10
  40. data/lib/luo/templates/demo.md.erb +0 -1
  41. data/lib/luo/templates/luo_xinghuo_agent_tool_input.md.erb +0 -16
  42. data/lib/luo/templates/xinghuo_agent_input.md.erb +0 -10
  43. data/lib/luo/templates/xinghuo_response_error.md.erb +0 -10
  44. data/luo.ipynb +0 -84
  45. data/templates/luo_agent_input.md.erb +0 -39
  46. data/templates/luo_agent_system.md.erb +0 -4
  47. data/templates/luo_agent_tool_input.md.erb +0 -10
  48. data/templates/luo_commit.md.erb +0 -2
  49. data/templates/luo_xinghuo_agent_input.md.erb +0 -10
  50. data/templates/luo_xinghuo_agent_tool_input.md.erb +0 -16
  51. data/templates/luo_xinghuo_response_error.md.erb +0 -10
  52. data/templates/prompt.demo.erb +0 -1
  53. /data/{lib/luo/projects → templates}/env +0 -0
  54. /data/{lib/luo/projects → templates}/init.rb +0 -0
  55. /data/{lib/luo/projects → templates}/prompts/agent_input.md.erb +0 -0
  56. /data/{lib/luo/projects → templates}/prompts/agent_system.md.erb +0 -0
  57. /data/{lib/luo/projects → templates}/prompts/agent_tool_input.md.erb +0 -0
  58. /data/{lib/luo/templates → templates/prompts}/luo_commit.md.erb +0 -0
  59. /data/{lib/luo/projects → templates}/prompts/xinghuo_agent_input.md.erb +0 -0
  60. /data/{lib/luo/projects → templates}/prompts/xinghuo_response_error.md.erb +0 -0
  61. /data/{lib/luo/projects → templates}/test.yml +0 -0
  62. /data/{lib/luo/projects → templates}/time_agent.rb +0 -0
  63. /data/{lib/luo/projects → templates}/weather_agent.rb +0 -0
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'luo', '~> 0.2.1'
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'luo', '~> 0.2.1'
4
+ gem 'pry', '~> 0.14.2'
5
+ gem 'iruby'
@@ -1,4 +1,8 @@
1
- require_relative 'init'
1
+ require 'luo'
2
+
3
+ Luo.app_setup do |loader|
4
+ loader.push_dir(File.join(__dir__, 'agents'))
5
+ end
2
6
 
3
7
  class Runner < XinghuoAgentRunner
4
8
  register WeatherAgent
@@ -0,0 +1,292 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "ac60deeb-0d75-478e-823a-dfe39e73aa72",
6
+ "metadata": {},
7
+ "source": [
8
+ "欢迎使用luo实验室"
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "code",
13
+ "execution_count": 1,
14
+ "id": "785fea13-bdfb-4bc6-80e7-1c53d8ca2f84",
15
+ "metadata": {
16
+ "tags": []
17
+ },
18
+ "outputs": [
19
+ {
20
+ "name": "stdout",
21
+ "output_type": "stream",
22
+ "text": [
23
+ "0.2.0\n"
24
+ ]
25
+ }
26
+ ],
27
+ "source": [
28
+ "# 初始化运行环境\n",
29
+ "require 'luo'\n",
30
+ "\n",
31
+ "Luo.notebook_setup do |loader|\n",
32
+ " loader.push_dir(File.join(__dir__, 'agents'))\n",
33
+ "end\n",
34
+ "\n",
35
+ "puts Luo::VERSION"
36
+ ]
37
+ },
38
+ {
39
+ "cell_type": "code",
40
+ "execution_count": 2,
41
+ "id": "87d49a44-a485-4331-b982-6a9143490771",
42
+ "metadata": {
43
+ "tags": []
44
+ },
45
+ "outputs": [
46
+ {
47
+ "data": {
48
+ "text/plain": [
49
+ "Luo::XinghuoFinalAgent"
50
+ ]
51
+ },
52
+ "execution_count": 2,
53
+ "metadata": {},
54
+ "output_type": "execute_result"
55
+ }
56
+ ],
57
+ "source": [
58
+ "class Runner < XinghuoAgentRunner\n",
59
+ " register WeatherAgent\n",
60
+ " register TimeAgent\n",
61
+ " register XinghuoFinalAgent\n",
62
+ "end"
63
+ ]
64
+ },
65
+ {
66
+ "cell_type": "code",
67
+ "execution_count": 3,
68
+ "id": "3b2b57cf-332e-4f4e-8b54-ee35950a0501",
69
+ "metadata": {
70
+ "tags": []
71
+ },
72
+ "outputs": [
73
+ {
74
+ "data": {
75
+ "text/plain": [
76
+ ":input"
77
+ ]
78
+ },
79
+ "execution_count": 3,
80
+ "metadata": {},
81
+ "output_type": "execute_result"
82
+ }
83
+ ],
84
+ "source": [
85
+ "$runner = Runner.new\n",
86
+ "\n",
87
+ "def input(text)\n",
88
+ " context = $runner.call(text)\n",
89
+ " Helpers.display_md <<~MD\n",
90
+ " ## Input:\n",
91
+ " #{text}\n",
92
+ "\n",
93
+ " ## Response:\n",
94
+ " #{context.response}\n",
95
+ "\n",
96
+ " ## Final Result:\n",
97
+ " #{context.final_result}\n",
98
+ "\n",
99
+ " ## History:\n",
100
+ " \n",
101
+ " ```ruby\n",
102
+ " #{context.histories.to_a}\n",
103
+ " ```\n",
104
+ " MD\n",
105
+ " puts \"\\n\\n\\n\"\n",
106
+ "end"
107
+ ]
108
+ },
109
+ {
110
+ "cell_type": "code",
111
+ "execution_count": 4,
112
+ "id": "4e5c17eb-1c13-4547-8a2e-d9aa886031a6",
113
+ "metadata": {
114
+ "tags": []
115
+ },
116
+ "outputs": [
117
+ {
118
+ "name": "stdout",
119
+ "output_type": "stream",
120
+ "text": [
121
+ "** call aiui weather **\n"
122
+ ]
123
+ },
124
+ {
125
+ "data": {
126
+ "text/html": [
127
+ "<style>.highlight table td { padding: 5px; }\n",
128
+ ".highlight table pre { margin: 0; }\n",
129
+ ".highlight, .highlight .w {\n",
130
+ " color: #24292f;\n",
131
+ " background-color: #f6f8fa;\n",
132
+ "}\n",
133
+ ".highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kv {\n",
134
+ " color: #cf222e;\n",
135
+ "}\n",
136
+ ".highlight .gr {\n",
137
+ " color: #f6f8fa;\n",
138
+ "}\n",
139
+ ".highlight .gd {\n",
140
+ " color: #82071e;\n",
141
+ " background-color: #ffebe9;\n",
142
+ "}\n",
143
+ ".highlight .nb {\n",
144
+ " color: #953800;\n",
145
+ "}\n",
146
+ ".highlight .nc {\n",
147
+ " color: #953800;\n",
148
+ "}\n",
149
+ ".highlight .no {\n",
150
+ " color: #953800;\n",
151
+ "}\n",
152
+ ".highlight .nn {\n",
153
+ " color: #953800;\n",
154
+ "}\n",
155
+ ".highlight .sr {\n",
156
+ " color: #116329;\n",
157
+ "}\n",
158
+ ".highlight .na {\n",
159
+ " color: #116329;\n",
160
+ "}\n",
161
+ ".highlight .nt {\n",
162
+ " color: #116329;\n",
163
+ "}\n",
164
+ ".highlight .gi {\n",
165
+ " color: #116329;\n",
166
+ " background-color: #dafbe1;\n",
167
+ "}\n",
168
+ ".highlight .kc {\n",
169
+ " color: #0550ae;\n",
170
+ "}\n",
171
+ ".highlight .l, .highlight .ld, .highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {\n",
172
+ " color: #0550ae;\n",
173
+ "}\n",
174
+ ".highlight .sb {\n",
175
+ " color: #0550ae;\n",
176
+ "}\n",
177
+ ".highlight .bp {\n",
178
+ " color: #0550ae;\n",
179
+ "}\n",
180
+ ".highlight .ne {\n",
181
+ " color: #0550ae;\n",
182
+ "}\n",
183
+ ".highlight .nl {\n",
184
+ " color: #0550ae;\n",
185
+ "}\n",
186
+ ".highlight .py {\n",
187
+ " color: #0550ae;\n",
188
+ "}\n",
189
+ ".highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm {\n",
190
+ " color: #0550ae;\n",
191
+ "}\n",
192
+ ".highlight .o, .highlight .ow {\n",
193
+ " color: #0550ae;\n",
194
+ "}\n",
195
+ ".highlight .gh {\n",
196
+ " color: #0550ae;\n",
197
+ " font-weight: bold;\n",
198
+ "}\n",
199
+ ".highlight .gu {\n",
200
+ " color: #0550ae;\n",
201
+ " font-weight: bold;\n",
202
+ "}\n",
203
+ ".highlight .s, .highlight .sa, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .sx, .highlight .s1, .highlight .ss {\n",
204
+ " color: #0a3069;\n",
205
+ "}\n",
206
+ ".highlight .nd {\n",
207
+ " color: #8250df;\n",
208
+ "}\n",
209
+ ".highlight .nf, .highlight .fm {\n",
210
+ " color: #8250df;\n",
211
+ "}\n",
212
+ ".highlight .err {\n",
213
+ " color: #f6f8fa;\n",
214
+ " background-color: #82071e;\n",
215
+ "}\n",
216
+ ".highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cp, .highlight .cpf, .highlight .c1, .highlight .cs {\n",
217
+ " color: #6e7781;\n",
218
+ "}\n",
219
+ ".highlight .gl {\n",
220
+ " color: #6e7781;\n",
221
+ "}\n",
222
+ ".highlight .gt {\n",
223
+ " color: #6e7781;\n",
224
+ "}\n",
225
+ ".highlight .ni {\n",
226
+ " color: #24292f;\n",
227
+ "}\n",
228
+ ".highlight .si {\n",
229
+ " color: #24292f;\n",
230
+ "}\n",
231
+ ".highlight .ge {\n",
232
+ " color: #24292f;\n",
233
+ " font-style: italic;\n",
234
+ "}\n",
235
+ ".highlight .gs {\n",
236
+ " color: #24292f;\n",
237
+ " font-weight: bold;\n",
238
+ "}</style>\n",
239
+ "<h2>Input:</h2>\n",
240
+ "\n",
241
+ "<p>明天的天气怎么样</p>\n",
242
+ "\n",
243
+ "<h2>Response:</h2>\n",
244
+ "\n",
245
+ "<p>调用工具:天气查询。</p>\n",
246
+ "\n",
247
+ "<h2>Final Result:</h2>\n",
248
+ "\n",
249
+ "<p>北京市明天全天小雨转多云,出门记得带伞,气温16℃ ~ 26℃,有南风转北风微风,气候温暖。</p>\n",
250
+ "\n",
251
+ "<h2>History:</h2>\n",
252
+ "<pre class=\"highlight\"><span class=\"p\">[{</span><span class=\"ss\">:role</span><span class=\"o\">=&gt;</span><span class=\"s2\">\"user\"</span><span class=\"p\">,</span> <span class=\"ss\">:content</span><span class=\"o\">=&gt;</span><span class=\"s2\">\"明天的天气怎么样\"</span><span class=\"p\">},</span> <span class=\"p\">{</span><span class=\"ss\">:role</span><span class=\"o\">=&gt;</span><span class=\"s2\">\"assistant\"</span><span class=\"p\">,</span> <span class=\"ss\">:content</span><span class=\"o\">=&gt;</span><span class=\"s2\">\"北京市明天全天小雨转多云,出门记得带伞,气温16℃ ~ 26℃,有南风转北风微风,气候温暖。\"</span><span class=\"p\">}]</span>\n",
253
+ "</pre>\n"
254
+ ],
255
+ "text/plain": [
256
+ "\"<style>.highlight table td { padding: 5px; }\\n.highlight table pre { margin: 0; }\\n.highlight, .highlight .w {\\n color: #24292f;\\n background-color: #f6f8fa;\\n}\\n.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kv {\\n color: #cf222e;\\n}\\n.highlight .gr {\\n color: #f6f8fa;\\n}\\n.highlight .gd {\\n color: #82071e;\\n background-color: #ffebe9;\\n}\\n.highlight .nb {\\n color: #953800;\\n}\\n.highlight .nc {\\n color: #953800;\\n}\\n.highlight .no {\\n color: #953800;\\n}\\n.highlight .nn {\\n color: #953800;\\n}\\n.highlight .sr {\\n color: #116329;\\n}\\n.highlight .na {\\n color: #116329;\\n}\\n.highlight .nt {\\n color: #116329;\\n}\\n.highlight .gi {\\n color: #116329;\\n background-color: #dafbe1;\\n}\\n.highlight .kc {\\n color: #0550ae;\\n}\\n.highlight .l, .highlight .ld, .highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {\\n color: #0550ae;\\n}\\n.highlight .sb {\\n color: #0550ae;\\n}\\n.highlight .bp {\\n color: #0550ae;\\n}\\n.highlight .ne {\\n color: #0550ae;\\n}\\n.highlight .nl {\\n color: #0550ae;\\n}\\n.highlight .py {\\n color: #0550ae;\\n}\\n.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm {\\n color: #0550ae;\\n}\\n.highlight .o, .highlight .ow {\\n color: #0550ae;\\n}\\n.highlight .gh {\\n color: #0550ae;\\n font-weight: bold;\\n}\\n.highlight .gu {\\n color: #0550ae;\\n font-weight: bold;\\n}\\n.highlight .s, .highlight .sa, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .sx, .highlight .s1, .highlight .ss {\\n color: #0a3069;\\n}\\n.highlight .nd {\\n color: #8250df;\\n}\\n.highlight .nf, .highlight .fm {\\n color: #8250df;\\n}\\n.highlight .err {\\n color: #f6f8fa;\\n background-color: #82071e;\\n}\\n.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cp, .highlight .cpf, .highlight .c1, .highlight .cs {\\n color: #6e7781;\\n}\\n.highlight .gl {\\n color: #6e7781;\\n}\\n.highlight .gt {\\n color: #6e7781;\\n}\\n.highlight .ni {\\n color: #24292f;\\n}\\n.highlight .si {\\n color: #24292f;\\n}\\n.highlight .ge {\\n color: #24292f;\\n font-style: italic;\\n}\\n.highlight .gs {\\n color: #24292f;\\n font-weight: bold;\\n}</style>\\n<h2>Input:</h2>\\n\\n<p>明天的天气怎么样</p>\\n\\n<h2>Response:</h2>\\n\\n<p>调用工具:天气查询。</p>\\n\\n<h2>Final Result:</h2>\\n\\n<p>北京市明天全天小雨转多云,出门记得带伞,气温16℃ ~ 26℃,有南风转北风微风,气候温暖。</p>\\n\\n<h2>History:</h2>\\n<pre class=\\\"highlight\\\"><span class=\\\"p\\\">[{</span><span class=\\\"ss\\\">:role</span><span class=\\\"o\\\">=&gt;</span><span class=\\\"s2\\\">\\\"user\\\"</span><span class=\\\"p\\\">,</span> <span class=\\\"ss\\\">:content</span><span class=\\\"o\\\">=&gt;</span><span class=\\\"s2\\\">\\\"明天的天气怎么样\\\"</span><span class=\\\"p\\\">},</span> <span class=\\\"p\\\">{</span><span class=\\\"ss\\\">:role</span><span class=\\\"o\\\">=&gt;</span><span class=\\\"s2\\\">\\\"assistant\\\"</span><span class=\\\"p\\\">,</span> <span class=\\\"ss\\\">:content</span><span class=\\\"o\\\">=&gt;</span><span class=\\\"s2\\\">\\\"北京市明天全天小雨转多云,出门记得带伞,气温16℃ ~ 26℃,有南风转北风微风,气候温暖。\\\"</span><span class=\\\"p\\\">}]</span>\\n</pre>\\n\""
257
+ ]
258
+ },
259
+ "metadata": {},
260
+ "output_type": "display_data"
261
+ },
262
+ {
263
+ "name": "stdout",
264
+ "output_type": "stream",
265
+ "text": [
266
+ "\n",
267
+ "\n",
268
+ "\n"
269
+ ]
270
+ }
271
+ ],
272
+ "source": [
273
+ "input \"明天的天气怎么样\""
274
+ ]
275
+ }
276
+ ],
277
+ "metadata": {
278
+ "kernelspec": {
279
+ "display_name": "Ruby 3.2.1",
280
+ "language": "ruby",
281
+ "name": "ruby"
282
+ },
283
+ "language_info": {
284
+ "file_extension": ".rb",
285
+ "mimetype": "application/x-ruby",
286
+ "name": "ruby",
287
+ "version": "3.2.1"
288
+ }
289
+ },
290
+ "nbformat": 4,
291
+ "nbformat_minor": 5
292
+ }
@@ -0,0 +1,8 @@
1
+ 下面是一个基于ruby thor实现的命令行工具,
2
+ 用户调的命令:
3
+ <%= command %>
4
+ 发生了下面的错误:
5
+ <%= error %>
6
+
7
+ --------------------
8
+ 用中文给用户提示信息,并且说明如何解决问题, 最好给出正确的命令示例
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - MJ
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-16 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -125,33 +125,73 @@ dependencies:
125
125
  - !ruby/object:Gem::Version
126
126
  version: 1.0.1
127
127
  - !ruby/object:Gem::Dependency
128
- name: dry-cli
128
+ name: tty-markdown
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - "~>"
132
132
  - !ruby/object:Gem::Version
133
- version: '1.0'
133
+ version: 0.7.2
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - "~>"
139
139
  - !ruby/object:Gem::Version
140
- version: '1.0'
140
+ version: 0.7.2
141
141
  - !ruby/object:Gem::Dependency
142
- name: tty-markdown
142
+ name: redcarpet
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - "~>"
146
146
  - !ruby/object:Gem::Version
147
- version: 0.7.2
147
+ version: '3.6'
148
148
  type: :runtime
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - "~>"
153
153
  - !ruby/object:Gem::Version
154
- version: 0.7.2
154
+ version: '3.6'
155
+ - !ruby/object:Gem::Dependency
156
+ name: rouge
157
+ requirement: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
160
+ - !ruby/object:Gem::Version
161
+ version: '4.1'
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: 4.1.1
165
+ type: :runtime
166
+ prerelease: false
167
+ version_requirements: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: '4.1'
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: 4.1.1
175
+ - !ruby/object:Gem::Dependency
176
+ name: thor
177
+ requirement: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: '1.2'
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: 1.2.2
185
+ type: :runtime
186
+ prerelease: false
187
+ version_requirements: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - "~>"
190
+ - !ruby/object:Gem::Version
191
+ version: '1.2'
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: 1.2.2
155
195
  - !ruby/object:Gem::Dependency
156
196
  name: rspec
157
197
  requirement: !ruby/object:Gem::Requirement
@@ -174,13 +214,6 @@ executables:
174
214
  extensions: []
175
215
  extra_rdoc_files: []
176
216
  files:
177
- - ".idea/.gitignore"
178
- - ".idea/dictionaries/mj.xml"
179
- - ".idea/inspectionProfiles/Project_Default.xml"
180
- - ".idea/luo.iml"
181
- - ".idea/misc.xml"
182
- - ".idea/modules.xml"
183
- - ".idea/vcs.xml"
184
217
  - ".rspec"
185
218
  - Dockerfile
186
219
  - Gemfile
@@ -190,51 +223,34 @@ files:
190
223
  - Rakefile
191
224
  - docker-compose.yml
192
225
  - exe/luo
193
- - init.rb
194
226
  - lib/luo.rb
195
227
  - lib/luo/agent.rb
196
228
  - lib/luo/agent_runner_base.rb
197
229
  - lib/luo/agent_runner_context.rb
198
230
  - lib/luo/aiui.rb
199
231
  - lib/luo/cli.rb
232
+ - lib/luo/cli/init_app.rb
233
+ - lib/luo/cli/init_base.rb
234
+ - lib/luo/cli/init_notebook.rb
200
235
  - lib/luo/configurable.rb
201
236
  - lib/luo/helpers.rb
202
237
  - lib/luo/http_client.rb
203
- - lib/luo/init_project.rb
238
+ - lib/luo/init_project._rb
204
239
  - lib/luo/loader.rb
205
240
  - lib/luo/marqo.rb
206
241
  - lib/luo/memory_history.rb
207
242
  - lib/luo/messages.rb
208
243
  - lib/luo/open_ai.rb
209
244
  - lib/luo/open_ai_agent_runner.rb
210
- - lib/luo/projects/application.rb
211
- - lib/luo/projects/env
212
- - lib/luo/projects/init.rb
213
- - lib/luo/projects/luo.ipynb
214
- - lib/luo/projects/prompts/agent_input.md.erb
215
- - lib/luo/projects/prompts/agent_system.md.erb
216
- - lib/luo/projects/prompts/agent_tool_input.md.erb
217
- - lib/luo/projects/prompts/xinghuo_agent_input.md.erb
218
- - lib/luo/projects/prompts/xinghuo_response_error.md.erb
219
- - lib/luo/projects/test.yml
220
- - lib/luo/projects/time_agent.rb
221
- - lib/luo/projects/weather_agent.rb
245
+ - lib/luo/parser_markdown.rb
246
+ - lib/luo/project_init.rb
222
247
  - lib/luo/prompt_template.rb
223
248
  - lib/luo/prompts.rb
224
- - lib/luo/templates/agent_input.md.erb
225
- - lib/luo/templates/agent_system.md.erb
226
- - lib/luo/templates/agent_tool_input.md.erb
227
- - lib/luo/templates/demo.md.erb
228
- - lib/luo/templates/luo_commit.md.erb
229
- - lib/luo/templates/luo_xinghuo_agent_tool_input.md.erb
230
- - lib/luo/templates/xinghuo_agent_input.md.erb
231
- - lib/luo/templates/xinghuo_response_error.md.erb
232
249
  - lib/luo/version.rb
233
250
  - lib/luo/xinghuo.rb
234
251
  - lib/luo/xinghuo_agent_runner.rb
235
252
  - luo
236
253
  - luo.gemspec
237
- - luo.ipynb
238
254
  - luo.ps1
239
255
  - sig/luo.rbs
240
256
  - sig/luo/agent.rbs
@@ -252,14 +268,22 @@ files:
252
268
  - sig/luo/prompt_template.rbs
253
269
  - sig/luo/prompts.rbs
254
270
  - sig/luo/xinghuo.rbs
255
- - templates/luo_agent_input.md.erb
256
- - templates/luo_agent_system.md.erb
257
- - templates/luo_agent_tool_input.md.erb
258
- - templates/luo_commit.md.erb
259
- - templates/luo_xinghuo_agent_input.md.erb
260
- - templates/luo_xinghuo_agent_tool_input.md.erb
261
- - templates/luo_xinghuo_response_error.md.erb
262
- - templates/prompt.demo.erb
271
+ - templates/AppGemfile
272
+ - templates/NoteBookGemfile
273
+ - templates/application.rb
274
+ - templates/env
275
+ - templates/init.rb
276
+ - templates/luo.ipynb
277
+ - templates/prompts/agent_input.md.erb
278
+ - templates/prompts/agent_system.md.erb
279
+ - templates/prompts/agent_tool_input.md.erb
280
+ - templates/prompts/luo_commit.md.erb
281
+ - templates/prompts/luo_error.md.erb
282
+ - templates/prompts/xinghuo_agent_input.md.erb
283
+ - templates/prompts/xinghuo_response_error.md.erb
284
+ - templates/test.yml
285
+ - templates/time_agent.rb
286
+ - templates/weather_agent.rb
263
287
  homepage: https://github.com/mjason/luo
264
288
  licenses: []
265
289
  metadata:
data/.idea/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
4
- # Editor-based HTTP Client requests
5
- /httpRequests/
6
- # Datasource local storage ignored files
7
- /dataSources/
8
- /dataSources.local.xml
@@ -1,7 +0,0 @@
1
- <component name="ProjectDictionaryState">
2
- <dictionary name="mj">
3
- <words>
4
- <w>marqo</w>
5
- </words>
6
- </dictionary>
7
- </component>
@@ -1,9 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="RubyClassVariableUsageInspection" enabled="false" level="WARNING" enabled_by_default="false" />
5
- <inspection_tool class="RubyResolve" enabled="false" level="WARNING" enabled_by_default="false">
6
- <option name="warnImplicitResults" value="false" />
7
- </inspection_tool>
8
- </profile>
9
- </component>
data/.idea/luo.iml DELETED
@@ -1,81 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="ModuleRunConfigurationManager">
4
- <shared />
5
- </component>
6
- <component name="NewModuleRootManager">
7
- <content url="file://$MODULE_DIR$">
8
- <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
- <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
- <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
- <excludeFolder url="file://$MODULE_DIR$/bundle_gems/cache" />
12
- </content>
13
- <orderEntry type="jdk" jdkName="ruby-3.2.1-p31" jdkType="RUBY_SDK" />
14
- <orderEntry type="sourceFolder" forTests="false" />
15
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.6, ruby-3.2.1-p31) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.2.2, ruby-3.2.1-p31) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, ruby-3.2.1-p31) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="dotenv (v2.8.1, ruby-3.2.1-p31) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="dry-cli (v1.0.0, ruby-3.2.1-p31) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="dry-configurable (v1.0.1, ruby-3.2.1-p31) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="dry-core (v1.0.0, ruby-3.2.1-p31) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="dry-inflector (v1.0.0, ruby-3.2.1-p31) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="dry-initializer (v3.1.1, ruby-3.2.1-p31) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="dry-logic (v1.5.0, ruby-3.2.1-p31) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="dry-schema (v1.13.1, ruby-3.2.1-p31) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="dry-types (v1.7.1, ruby-3.2.1-p31) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="faraday (v2.7.4, ruby-3.2.1-p31) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="faraday-net_http (v3.0.2, ruby-3.2.1-p31) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="faraday-retry (v2.1.0, ruby-3.2.1-p31) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="kramdown (v2.4.0, ruby-3.2.1-p31) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="pastel (v0.8.0, ruby-3.2.1-p31) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, ruby-3.2.1-p31) [gem]" level="application" />
33
- <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, ruby-3.2.1-p31) [gem]" level="application" />
34
- <orderEntry type="library" scope="PROVIDED" name="rouge (v4.1.0, ruby-3.2.1-p31) [gem]" level="application" />
35
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.12.0, ruby-3.2.1-p31) [gem]" level="application" />
36
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.12.2, ruby-3.2.1-p31) [gem]" level="application" />
37
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.12.3, ruby-3.2.1-p31) [gem]" level="application" />
38
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.12.5, ruby-3.2.1-p31) [gem]" level="application" />
39
- <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.12.0, ruby-3.2.1-p31) [gem]" level="application" />
40
- <orderEntry type="library" scope="PROVIDED" name="strings (v0.2.1, ruby-3.2.1-p31) [gem]" level="application" />
41
- <orderEntry type="library" scope="PROVIDED" name="strings-ansi (v0.2.0, ruby-3.2.1-p31) [gem]" level="application" />
42
- <orderEntry type="library" scope="PROVIDED" name="tty-color (v0.6.0, ruby-3.2.1-p31) [gem]" level="application" />
43
- <orderEntry type="library" scope="PROVIDED" name="tty-markdown (v0.7.2, ruby-3.2.1-p31) [gem]" level="application" />
44
- <orderEntry type="library" scope="PROVIDED" name="tty-screen (v0.8.1, ruby-3.2.1-p31) [gem]" level="application" />
45
- <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.4.2, ruby-3.2.1-p31) [gem]" level="application" />
46
- <orderEntry type="library" scope="PROVIDED" name="unicode_utils (v1.4.0, ruby-3.2.1-p31) [gem]" level="application" />
47
- <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.6.8, ruby-3.2.1-p31) [gem]" level="application" />
48
- </component>
49
- <component name="RakeTasksCache">
50
- <option name="myRootTask">
51
- <RakeTaskImpl id="rake">
52
- <subtasks>
53
- <RakeTaskImpl description="Build luo-0.1.4.gem into the pkg directory" fullCommand="build" id="build" />
54
- <RakeTaskImpl id="build">
55
- <subtasks>
56
- <RakeTaskImpl description="Generate SHA512 checksum if luo-0.1.4.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
57
- </subtasks>
58
- </RakeTaskImpl>
59
- <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
60
- <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
61
- <RakeTaskImpl description="Build and install luo-0.1.4.gem into system gems" fullCommand="install" id="install" />
62
- <RakeTaskImpl id="install">
63
- <subtasks>
64
- <RakeTaskImpl description="Build and install luo-0.1.4.gem into system gems without network access" fullCommand="install:local" id="local" />
65
- </subtasks>
66
- </RakeTaskImpl>
67
- <RakeTaskImpl description="Create tag v0.1.4 and build and push luo-0.1.4.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
68
- <RakeTaskImpl description="" fullCommand="default" id="default" />
69
- <RakeTaskImpl description="" fullCommand="release" id="release" />
70
- <RakeTaskImpl id="release">
71
- <subtasks>
72
- <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
73
- <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
74
- <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
75
- </subtasks>
76
- </RakeTaskImpl>
77
- </subtasks>
78
- </RakeTaskImpl>
79
- </option>
80
- </component>
81
- </module>
data/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.6.10-p210" project-jdk-type="RUBY_SDK" />
4
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/luo.iml" filepath="$PROJECT_DIR$/.idea/luo.iml" />
6
- </modules>
7
- </component>
8
- </project>
data/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>