luo 0.1.18 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/luo/init_project.rb +1 -0
- data/lib/luo/projects/luo.ipynb +89 -6
- data/lib/luo/version.rb +1 -1
- data/luo +8 -13
- metadata +1 -2
- data/.ipynb_checkpoints/luo-checkpoint.ipynb +0 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8704c313023d8ec033957282a0585bdbeeb51d9f76a7fe5415b48dbfff412c75
|
4
|
+
data.tar.gz: 847d8309389a0f8de711bb674014b45942c64a3719a027009a309a7ca741ef63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240f45ee887a39ed426da4288ac259b4666a714dfa9c725417ba2b7ffe877f8bce2f58205c93847d64babcec8f59f8c2ea571a14c2a6736bc7731b9620bec788
|
7
|
+
data.tar.gz: d6fd03c0f45a0e406ff4861d4aef98d669fede266960620da40886f3c25fd95ba1d97cf80b9a00a95018e1e9cffec2cd9b50f8b0296c8858fe5d5be945cfcf58
|
data/Gemfile.lock
CHANGED
data/lib/luo/init_project.rb
CHANGED
data/lib/luo/projects/luo.ipynb
CHANGED
@@ -12,7 +12,9 @@
|
|
12
12
|
"cell_type": "code",
|
13
13
|
"execution_count": 1,
|
14
14
|
"id": "785fea13-bdfb-4bc6-80e7-1c53d8ca2f84",
|
15
|
-
"metadata": {
|
15
|
+
"metadata": {
|
16
|
+
"tags": []
|
17
|
+
},
|
16
18
|
"outputs": [
|
17
19
|
{
|
18
20
|
"data": {
|
@@ -27,12 +29,14 @@
|
|
27
29
|
],
|
28
30
|
"source": [
|
29
31
|
"# 初始化运行环境\n",
|
30
|
-
"require_relative \"init\""
|
32
|
+
"require_relative \"init\"\n",
|
33
|
+
"require 'pry'\n",
|
34
|
+
"IRuby::Kernel.instance.switch_backend!(:pry)"
|
31
35
|
]
|
32
36
|
},
|
33
37
|
{
|
34
38
|
"cell_type": "code",
|
35
|
-
"execution_count":
|
39
|
+
"execution_count": 2,
|
36
40
|
"id": "87d49a44-a485-4331-b982-6a9143490771",
|
37
41
|
"metadata": {
|
38
42
|
"tags": []
|
@@ -44,7 +48,7 @@
|
|
44
48
|
"Luo::XinghuoFinalAgent"
|
45
49
|
]
|
46
50
|
},
|
47
|
-
"execution_count":
|
51
|
+
"execution_count": 2,
|
48
52
|
"metadata": {},
|
49
53
|
"output_type": "execute_result"
|
50
54
|
}
|
@@ -59,8 +63,87 @@
|
|
59
63
|
},
|
60
64
|
{
|
61
65
|
"cell_type": "code",
|
62
|
-
"execution_count":
|
66
|
+
"execution_count": 4,
|
63
67
|
"id": "3b2b57cf-332e-4f4e-8b54-ee35950a0501",
|
68
|
+
"metadata": {
|
69
|
+
"tags": []
|
70
|
+
},
|
71
|
+
"outputs": [
|
72
|
+
{
|
73
|
+
"data": {
|
74
|
+
"text/plain": [
|
75
|
+
":input"
|
76
|
+
]
|
77
|
+
},
|
78
|
+
"execution_count": 4,
|
79
|
+
"metadata": {},
|
80
|
+
"output_type": "execute_result"
|
81
|
+
}
|
82
|
+
],
|
83
|
+
"source": [
|
84
|
+
"$runner = Runner.new\n",
|
85
|
+
"\n",
|
86
|
+
"def input(text)\n",
|
87
|
+
" context = $runner.call(text)\n",
|
88
|
+
" Helpers.print_md <<~MD\n",
|
89
|
+
" ## Input:\n",
|
90
|
+
" #{text}\n",
|
91
|
+
"\n",
|
92
|
+
" ## Response:\n",
|
93
|
+
" #{context.response}\n",
|
94
|
+
"\n",
|
95
|
+
" ## Final Result:\n",
|
96
|
+
" #{context.final_result}\n",
|
97
|
+
"\n",
|
98
|
+
" ## History:\n",
|
99
|
+
" ```ruby\n",
|
100
|
+
" #{context.histories.to_a}\n",
|
101
|
+
" ```\n",
|
102
|
+
" MD\n",
|
103
|
+
" puts \"\\n\\n\\n\"\n",
|
104
|
+
"end"
|
105
|
+
]
|
106
|
+
},
|
107
|
+
{
|
108
|
+
"cell_type": "code",
|
109
|
+
"execution_count": 5,
|
110
|
+
"id": "3add85ed-2b49-4a5b-b625-eaf915825050",
|
111
|
+
"metadata": {
|
112
|
+
"tags": []
|
113
|
+
},
|
114
|
+
"outputs": [
|
115
|
+
{
|
116
|
+
"name": "stdout",
|
117
|
+
"output_type": "stream",
|
118
|
+
"text": [
|
119
|
+
"** call aiui weather **\n",
|
120
|
+
" Input:\n",
|
121
|
+
" 明天的天气怎么样\n",
|
122
|
+
"\n",
|
123
|
+
" Response:\n",
|
124
|
+
" 调用工具:天气查询。\n",
|
125
|
+
"\n",
|
126
|
+
" Final Result:\n",
|
127
|
+
" 明天北京市全天多云,气温16℃ ~ 28℃,空气质量良,有南风微风,气候温暖。\n",
|
128
|
+
"\n",
|
129
|
+
" History:\n",
|
130
|
+
" [{:role=>\"user\", :content=>\"明天的天气怎么样\"}, {:role=>\"assistant\", \n",
|
131
|
+
" :content=>\"明天北京市全天多云,气温16℃ ~ \n",
|
132
|
+
" 28℃,空气质量良,有南风微风,气候温暖。\"}]\n",
|
133
|
+
"\n",
|
134
|
+
"\n",
|
135
|
+
"\n"
|
136
|
+
]
|
137
|
+
}
|
138
|
+
],
|
139
|
+
"source": [
|
140
|
+
"input \"明天的天气怎么样\""
|
141
|
+
]
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"cell_type": "code",
|
145
|
+
"execution_count": null,
|
146
|
+
"id": "ca165db3-1711-41c3-85eb-3f7f02d04e0a",
|
64
147
|
"metadata": {},
|
65
148
|
"outputs": [],
|
66
149
|
"source": []
|
@@ -68,7 +151,7 @@
|
|
68
151
|
],
|
69
152
|
"metadata": {
|
70
153
|
"kernelspec": {
|
71
|
-
"display_name": "Ruby 3.2.
|
154
|
+
"display_name": "Ruby 3.2.2",
|
72
155
|
"language": "ruby",
|
73
156
|
"name": "ruby"
|
74
157
|
},
|
data/lib/luo/version.rb
CHANGED
data/luo
CHANGED
@@ -1,19 +1,14 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
#docker run --rm -it \
|
10
|
-
# -v "$PWD:/workdir" \
|
11
|
-
# -v "$PWD/bundle_gems:/usr/local/bundle/" \
|
12
|
-
# ghcr.io/mjason/luo:latest \
|
13
|
-
# "$@"
|
3
|
+
if [[ $1 == "update" ]]; then
|
4
|
+
echo "Pulling the latest Docker image..."
|
5
|
+
docker pull ghcr.io/mjason/luo:latest
|
6
|
+
fi
|
7
|
+
|
8
|
+
echo "Running the Docker container..."
|
14
9
|
|
15
|
-
# 性能高
|
16
10
|
docker run --rm -it \
|
11
|
+
-p 8888:8888 \
|
17
12
|
-v "$PWD:/workdir" \
|
18
13
|
ghcr.io/mjason/luo:latest \
|
19
|
-
"$@"
|
14
|
+
"$@"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MJ
|
@@ -180,7 +180,6 @@ files:
|
|
180
180
|
- ".idea/misc.xml"
|
181
181
|
- ".idea/modules.xml"
|
182
182
|
- ".idea/vcs.xml"
|
183
|
-
- ".ipynb_checkpoints/luo-checkpoint.ipynb"
|
184
183
|
- ".rspec"
|
185
184
|
- Dockerfile
|
186
185
|
- Gemfile
|
@@ -1,84 +0,0 @@
|
|
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
|
-
"outputs": [
|
17
|
-
{
|
18
|
-
"data": {
|
19
|
-
"text/plain": [
|
20
|
-
"true"
|
21
|
-
]
|
22
|
-
},
|
23
|
-
"execution_count": 1,
|
24
|
-
"metadata": {},
|
25
|
-
"output_type": "execute_result"
|
26
|
-
}
|
27
|
-
],
|
28
|
-
"source": [
|
29
|
-
"# 初始化运行环境\n",
|
30
|
-
"require_relative \"init\""
|
31
|
-
]
|
32
|
-
},
|
33
|
-
{
|
34
|
-
"cell_type": "code",
|
35
|
-
"execution_count": 6,
|
36
|
-
"id": "87d49a44-a485-4331-b982-6a9143490771",
|
37
|
-
"metadata": {
|
38
|
-
"tags": []
|
39
|
-
},
|
40
|
-
"outputs": [
|
41
|
-
{
|
42
|
-
"data": {
|
43
|
-
"text/plain": [
|
44
|
-
"Luo::XinghuoFinalAgent"
|
45
|
-
]
|
46
|
-
},
|
47
|
-
"execution_count": 6,
|
48
|
-
"metadata": {},
|
49
|
-
"output_type": "execute_result"
|
50
|
-
}
|
51
|
-
],
|
52
|
-
"source": [
|
53
|
-
"class Runner < XinghuoAgentRunner\n",
|
54
|
-
" register WeatherAgent\n",
|
55
|
-
" register TimeAgent\n",
|
56
|
-
" register XinghuoFinalAgent\n",
|
57
|
-
"end"
|
58
|
-
]
|
59
|
-
},
|
60
|
-
{
|
61
|
-
"cell_type": "code",
|
62
|
-
"execution_count": null,
|
63
|
-
"id": "3b2b57cf-332e-4f4e-8b54-ee35950a0501",
|
64
|
-
"metadata": {},
|
65
|
-
"outputs": [],
|
66
|
-
"source": []
|
67
|
-
}
|
68
|
-
],
|
69
|
-
"metadata": {
|
70
|
-
"kernelspec": {
|
71
|
-
"display_name": "Ruby 3.2.1",
|
72
|
-
"language": "ruby",
|
73
|
-
"name": "ruby"
|
74
|
-
},
|
75
|
-
"language_info": {
|
76
|
-
"file_extension": ".rb",
|
77
|
-
"mimetype": "application/x-ruby",
|
78
|
-
"name": "ruby",
|
79
|
-
"version": "3.2.1"
|
80
|
-
}
|
81
|
-
},
|
82
|
-
"nbformat": 4,
|
83
|
-
"nbformat_minor": 5
|
84
|
-
}
|