luo 0.2.2 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e2f307cd4e0e397dfda5f5a540267d519bfac40dd0f7067948aa6211b6280a1
4
- data.tar.gz: 763b3ae18becb12d6546667567406673564ee5016675424986dcfc3bdf288528
3
+ metadata.gz: 6b2af1ba5e628a075900879b4f2b54efceac535fe816fe9863535c51c33e6de1
4
+ data.tar.gz: a8a7e2c548676dfd4adb6ca35e41e3cd3451930f845be02d06af7d38ca0c4e44
5
5
  SHA512:
6
- metadata.gz: 48dbac5c5f6101910faa01d556a29368ef5bc19289ca0021746bd3b6a62e1414b14efb71b63a3791c92ecc4c371b49168bd956cb01b5804309f8b18f6301aa44
7
- data.tar.gz: e048e9fa7ab6554a8752acbbeb757633bb149a9e8b24edd9dd023305fecef0b9d9ba32801a4ce9b2f8da35b99fbb0a7c5801b5bc2dc2e3620b68cb72b7b6e477
6
+ metadata.gz: b0fa9249b55d4ee157c57966e2ac362f5827fce4cb2b82382d9f6ee7637b29ac6084a04130d67d4d91a1b91bfbbc1088b14f45d85419b3702332b9d9d3118fbd
7
+ data.tar.gz: fcb78e2300c5dddce4a32ce6eadb208af15453751d49cab20b6e8c8ab7b9521ef4f08cd6eb231452e82f87ecf375b52ac99c5b189da9f9b869621cf8e17d8f60
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- luo (0.2.2)
4
+ luo (0.2.4)
5
5
  dotenv (~> 2.8, >= 2.8.1)
6
6
  dry-configurable (~> 1.0, >= 1.0.1)
7
7
  dry-schema (~> 1.13, >= 1.13.1)
@@ -10,7 +10,7 @@ module Luo
10
10
 
11
11
  def copy_gemfile
12
12
  say "Copying Gemfile...", :green
13
- copy_file "AppGemfile", "Gemfile"
13
+ template "AppGemfile.erb", "Gemfile"
14
14
  end
15
15
  end
16
16
  end
@@ -12,7 +12,7 @@ module Luo
12
12
 
13
13
  def copy_gemfile
14
14
  say "Copying Gemfile...", :green
15
- copy_file "NotebookGemfile", "Gemfile"
15
+ template "NotebookGemfile.erb", "Gemfile"
16
16
  end
17
17
 
18
18
  end
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.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'luo', '~> <%= Luo::VERSION %>'
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'luo', '~> 0.2.1'
3
+ gem 'luo', '~> <%= Luo::VERSION %>'
4
4
  gem 'pry', '~> 0.14.2'
5
5
  gem 'iruby'
data/templates/env CHANGED
@@ -3,5 +3,5 @@ OPENAI_TEMPERATURE=0 # OpenAI的温度
3
3
  OPENAI_LIMIT_HISTORY=6 # OpenAI的历史记录长度
4
4
  AIUI_APP_KEY= # AIUI的AppKey
5
5
  AIUI_APP_ID= # AIUI的AppID
6
- XINGHUO_ACCESS_TOKEN= # 星火的访问令牌
6
+ LISTENAI_ACCESS_TOKEN= # 星火的访问令牌
7
7
  OPENAI_CHAT_MODEL=gpt-3.5-turbo
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.2.2
4
+ version: 0.2.4
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-24 00:00:00.000000000 Z
11
+ date: 2023-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -236,7 +236,6 @@ files:
236
236
  - lib/luo/error_handle.rb
237
237
  - lib/luo/helpers.rb
238
238
  - lib/luo/http_client.rb
239
- - lib/luo/init_project._rb
240
239
  - lib/luo/loader.rb
241
240
  - lib/luo/marqo.rb
242
241
  - lib/luo/memory_history.rb
@@ -269,8 +268,8 @@ files:
269
268
  - sig/luo/prompt_template.rbs
270
269
  - sig/luo/prompts.rbs
271
270
  - sig/luo/xinghuo.rbs
272
- - templates/AppGemfile
273
- - templates/NoteBookGemfile
271
+ - templates/AppGemfile.erb
272
+ - templates/NotebookGemfile.erb
274
273
  - templates/application.rb
275
274
  - templates/env
276
275
  - templates/init.rb
@@ -1,71 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Luo
4
- module InitProject
5
- extend self
6
-
7
- def project_template_file(name)
8
- File.join(File.dirname(__FILE__), 'projects', name)
9
- end
10
- def create_bundle_file()
11
- puts "create Gemfile"
12
- version = Luo::VERSION
13
- unless File.exist?('Gemfile')
14
- gemfile = <<-GEMFILE.gsub(/^ */, '')
15
- source 'https://rubygems.org'
16
- gem 'luo'
17
- gem 'iruby'
18
- gem 'pry'
19
- GEMFILE
20
- File.open('Gemfile', 'w') do |file|
21
- file.puts(gemfile)
22
- end
23
- end
24
- end
25
-
26
- def create_templates
27
- puts "create templates directory"
28
- unless File.directory?('templates')
29
- FileUtils.cp_r(File.join(__dir__, 'projects', 'prompts'), 'prompts')
30
- end
31
- end
32
-
33
- def create_agent_directory
34
- puts "create agent directory"
35
- FileUtils.mkdir_p('agents')
36
- end
37
-
38
- def create_application
39
- puts "create application"
40
- copy_file('init.rb', 'init.rb')
41
- copy_file('application.rb', 'app.rb')
42
- copy_file('env', '.env')
43
- copy_file('time_agent.rb', 'agents/time_agent.rb')
44
- copy_file('weather_agent.rb', 'agents/weather_agent.rb')
45
- copy_file('luo.ipynb', 'luo.ipynb')
46
- copy_file("test.yml", "test.yml")
47
- end
48
-
49
- def copy_file(file_name, target_file_name)
50
- puts "copy #{file_name} to #{target_file_name}"
51
- unless File.exist?(target_file_name)
52
- FileUtils.copy_file(project_template_file(file_name), target_file_name)
53
- end
54
- end
55
-
56
- def run()
57
- create_bundle_file
58
- create_templates
59
- create_agent_directory
60
- create_application
61
-
62
- Helpers.print_md """
63
- ## Luo Project Initialized
64
- You can now run `bundle install` to install the dependencies
65
- and edit .env to add your API key.
66
- and `bundle exec ruby application.rb` to run the project.
67
- """
68
- end
69
-
70
- end
71
- end
data/templates/AppGemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem 'luo', '~> 0.2.1'