luo 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2721c5f83c0322dbd49ed200ee05740604e9398483d64eb4f8845f4bed0e58ce
4
- data.tar.gz: 91f9f1c00f36ac96b51aabbe78a308bdc6da83b9580dda0dae1686ccc69b03e0
3
+ metadata.gz: adfb2e4a7dc78ddffac500eb49ad1d1cace2fee733c956f883d7333009b4c60c
4
+ data.tar.gz: 691f9f3cb1f4bee101b9fb71659426a9960e2eeb74b57c68ab37628e41b867e3
5
5
  SHA512:
6
- metadata.gz: 26b489a296e9b51a5f21af4a2358f6e3d2fb1a4fc9a9b5a9ead115da9db0dc88e2c6badc7770266b778cf21e9ac9631ed26bd82bbeee629e49248da1cefb3de2
7
- data.tar.gz: 2b7c099a3321deb860e40c146dda2a6c5c2ef718e4c843448f01b18bb009de9c7f582175cd42c1cc43991ea1f81fd721ce1bb0d4433529c32ae6b03021b1a039
6
+ metadata.gz: 6b3762db47bb0f75996d89deb0202b3cb4b09f6ba5204e47febc8a20ce23d58f41c8860b3af867a20cc517b519f627cbbd2fbd17dac8426400d9657e0fe2e9d3
7
+ data.tar.gz: faf5099423169ce3c7d7b98e5c0c52923bd0ff3cfe448bcc961abd7278b4e03972a3c2e1fa010943d4e3bccbd64e2d6c06459fc196053c277d51333dbd5d3ecd
@@ -0,0 +1,84 @@
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
+ }
data/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
- FROM ruby:3.2.2-alpine
1
+ FROM ruby:3.2.2
2
2
 
3
3
  # Install docker/buildx-bin
4
- COPY --from=docker/buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx
4
+ #COPY --from=docker/buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx
5
5
 
6
6
  # Set the working directory to /luo
7
7
  WORKDIR /luo
@@ -12,12 +12,25 @@ COPY Gemfile Gemfile.lock luo.gemspec ./
12
12
  # Required in luo.gemspec
13
13
  COPY lib/luo/version.rb /luo/lib/luo/version.rb
14
14
 
15
- # Install system dependencies
16
- RUN apk add --no-cache --update build-base git docker openrc openssh-client-default \
17
- && rc-update add docker boot \
18
- && gem install bundler --version=2.4.3 \
15
+ RUN apt-get update && apt-get install -y --no-install-recommends \
16
+ build-essential gcc \
17
+ && gem install bundler --version=2.4.6 \
19
18
  && bundle install
20
19
 
20
+ ## install python and jupyterlab
21
+ # Install Python and JupyterLab
22
+ RUN apt-get install -y --no-install-recommends \
23
+ python3 python3-pip python3-dev && \
24
+ pip3 install --no-cache-dir jupyterlab && \
25
+ pip3 install jupyterlab-language-pack-zh-CN
26
+
27
+ RUN gem install pry
28
+ RUN gem install iruby
29
+ RUN iruby register --force
30
+
31
+ # Expose the JupyterLab port
32
+ EXPOSE 8888
33
+
21
34
  # Copy the rest of our application code into the container.
22
35
  # We do this after bundle install, to avoid having to run bundle
23
36
  # everytime we do small fixes in the source code.
@@ -27,8 +40,7 @@ COPY . .
27
40
  RUN gem build luo.gemspec && \
28
41
  gem install ./luo-*.gem --no-document
29
42
 
30
- RUN git config --global --add safe.directory /workdir
31
-
32
43
  WORKDIR /workdir
44
+ RUN rm -rf /luo
33
45
 
34
46
  ENTRYPOINT ["luo"]
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- luo (0.1.17)
4
+ luo (0.1.18)
5
5
  dotenv (~> 2.8, >= 2.8.1)
6
6
  dry-cli (~> 1.0)
7
7
  dry-configurable (~> 1.0, >= 1.0.1)
@@ -0,0 +1,6 @@
1
+ services:
2
+ luo:
3
+ build: .
4
+ command: r
5
+ ports:
6
+ - 8888:8888
data/init.rb ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/setup"
4
+ Bundler.require
5
+
6
+ require 'luo'
7
+ include Luo
8
+
9
+ Loader.push_dir(File.join(__dir__, 'agents'))
10
+ Loader.setup
11
+
12
+ begin
13
+ IRuby::Kernel.instance.switch_backend!(:pry)
14
+ rescue => e
15
+ #
16
+ end
data/lib/luo/cli.rb CHANGED
@@ -37,7 +37,7 @@ module Luo
37
37
  desc "Run Luo"
38
38
 
39
39
  def call(*)
40
- exec "ruby app.rb"
40
+ exec "jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root"
41
41
  end
42
42
  end
43
43
 
@@ -40,6 +40,7 @@ module Luo
40
40
  copy_file('env', '.env')
41
41
  copy_file('time_agent.rb', 'agents/time_agent.rb')
42
42
  copy_file('weather_agent.rb', 'agents/weather_agent.rb')
43
+ copy_file('luo.ipynb', 'luo.ipynb')
43
44
  copy_file("test.yml", "test.yml")
44
45
  end
45
46
 
@@ -7,4 +7,10 @@ require 'luo'
7
7
  include Luo
8
8
 
9
9
  Loader.push_dir(File.join(__dir__, 'agents'))
10
- Loader.setup
10
+ Loader.setup
11
+
12
+ begin
13
+ IRuby::Kernel.instance.switch_backend!(:pry)
14
+ rescue => e
15
+ #
16
+ end
@@ -0,0 +1,84 @@
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.2"
80
+ }
81
+ },
82
+ "nbformat": 4,
83
+ "nbformat_minor": 5
84
+ }
data/lib/luo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Luo
4
- VERSION = "0.1.17"
4
+ VERSION = "0.1.18"
5
5
  end
data/luo.ipynb ADDED
@@ -0,0 +1,84 @@
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
+ }
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.17
4
+ version: 0.1.18
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-11 00:00:00.000000000 Z
11
+ date: 2023-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -180,6 +180,7 @@ files:
180
180
  - ".idea/misc.xml"
181
181
  - ".idea/modules.xml"
182
182
  - ".idea/vcs.xml"
183
+ - ".ipynb_checkpoints/luo-checkpoint.ipynb"
183
184
  - ".rspec"
184
185
  - Dockerfile
185
186
  - Gemfile
@@ -187,7 +188,9 @@ files:
187
188
  - README.md
188
189
  - README.zh.md
189
190
  - Rakefile
191
+ - docker-compose.yml
190
192
  - exe/luo
193
+ - init.rb
191
194
  - lib/luo.rb
192
195
  - lib/luo/agent.rb
193
196
  - lib/luo/agent_runner_base.rb
@@ -206,6 +209,7 @@ files:
206
209
  - lib/luo/projects/application.rb
207
210
  - lib/luo/projects/env
208
211
  - lib/luo/projects/init.rb
212
+ - lib/luo/projects/luo.ipynb
209
213
  - lib/luo/projects/prompts/agent_input.md.erb
210
214
  - lib/luo/projects/prompts/agent_system.md.erb
211
215
  - lib/luo/projects/prompts/agent_tool_input.md.erb
@@ -229,6 +233,7 @@ files:
229
233
  - lib/luo/xinghuo_agent_runner.rb
230
234
  - luo
231
235
  - luo.gemspec
236
+ - luo.ipynb
232
237
  - sig/luo.rbs
233
238
  - sig/luo/agent.rbs
234
239
  - sig/luo/agent_runner_base.rbs