nano-bots 1.1.0 → 1.1.2

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: 8b15d457541548f43fcc6d1c7cf7724c2e22a6505c0ca82e95681617e70259bd
4
- data.tar.gz: c5b20938128e993273a0759e6c0e5571a90f67fe59d7b43a36967254dab3bf40
3
+ metadata.gz: 9e2cff31d309d896be4e019fa6f39a86d68c6463c83c552b44d1bdf270d160b5
4
+ data.tar.gz: 8d506a1a13e2f85efb47a5149dc9ecd4519a49be8f26d139b5309f23e846aebe
5
5
  SHA512:
6
- metadata.gz: 2915fddd84a82616a2457bb6ef6d2acb6c7e3ad83beb9fb162033326047b123d43ec3c80764e27b6dbf5b0827a5dc2e3ed9781de3d44d787a188e1724043ab4e
7
- data.tar.gz: b9413865e968eddf7f38e506c7ed96760c2734dea25ddcacac504e58a8ed45f0573d8b1a42285fddd5ddacfe0acbf710d9e804af827338bb58e0e1cbc5163bc8
6
+ metadata.gz: a95508200927eff8dc6bbb7d6a1ca84e6c4ec4a0ff0ff549d6650f862a17ec5f56fe5e68ddfa3acf699f2ef2462527e0f63ec753c494c62149ff604cc17f6983
7
+ data.tar.gz: cf285799aba18d3dfe7680cbc47a2a09805953d1bf2ed65a29f8da78553f9d4e06a56b2ec9984f5819847790659df80636b02255c3b32ba1acb58670d4398458
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 3.1.4
2
+ TargetRubyVersion: 3.1.0
3
3
  NewCops: enable
4
4
 
5
5
  Style/Documentation:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.4
1
+ 3.1.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nano-bots (1.1.0)
4
+ nano-bots (1.1.2)
5
5
  babosa (~> 2.0)
6
6
  concurrent-ruby (~> 1.2, >= 1.2.2)
7
7
  dotenv (~> 2.8, >= 2.8.1)
data/README.md CHANGED
@@ -30,13 +30,13 @@ https://user-images.githubusercontent.com/113217272/238141567-c58a240c-7b67-4b3b
30
30
  For a system usage:
31
31
 
32
32
  ```sh
33
- gem install nano-bots -v 1.1.0
33
+ gem install nano-bots -v 1.1.2
34
34
  ```
35
35
 
36
36
  To use it in a project, add it to your `Gemfile`:
37
37
 
38
38
  ```ruby
39
- gem 'nano-bots', '~> 1.1.0'
39
+ gem 'nano-bots', '~> 1.1.2'
40
40
  ```
41
41
 
42
42
  ```sh
@@ -86,7 +86,7 @@ Set your provider credentials and choose your desired directory for the cartridg
86
86
  services:
87
87
  nano-bots:
88
88
  image: ruby:3.2.2-slim-bookworm
89
- command: sh -c "apt-get update && apt-get install -y --no-install-recommends build-essential libffi-dev libsodium-dev lua5.4-dev curl && curl -s https://raw.githubusercontent.com/babashka/babashka/master/install | bash && gem install nano-bots -v 1.1.0 && bash"
89
+ command: sh -c "apt-get update && apt-get install -y --no-install-recommends build-essential libffi-dev libsodium-dev lua5.4-dev curl && curl -s https://raw.githubusercontent.com/babashka/babashka/master/install | bash && gem install nano-bots -v 1.1.2 && bash"
90
90
  environment:
91
91
  OPENAI_API_ADDRESS: https://api.openai.com
92
92
  OPENAI_API_KEY: your-access-token
@@ -111,6 +111,8 @@ nb assistant.yml - eval "hello"
111
111
  nb assistant.yml - repl
112
112
  ```
113
113
 
114
+ You can exit the REPL by typing `exit`.
115
+
114
116
  ## Usage
115
117
 
116
118
  ### Command Line
@@ -159,6 +161,8 @@ well. How can I assist you?
159
161
  🤖> |
160
162
  ```
161
163
 
164
+ You can exit the REPL by typing `exit`.
165
+
162
166
  All of the commands above are stateless. If you want to preserve the history of your interactions, replace the `-` with a state key:
163
167
 
164
168
  ```bash
@@ -488,5 +492,5 @@ gem build nano-bots.gemspec
488
492
 
489
493
  gem signin
490
494
 
491
- gem push nano-bots-1.1.0.gem
495
+ gem push nano-bots-1.1.2.gem
492
496
  ```
data/components/stream.rb CHANGED
@@ -13,7 +13,11 @@ module NanoBot
13
13
  @accumulated = "#{@accumulated.force_encoding('UTF-8')}#{args.first.force_encoding('UTF-8')}"
14
14
  end
15
15
 
16
- @callback.call(@accumulated, args.first, false, args[1])
16
+ if @callback.arity == 3
17
+ @callback.call(@accumulated, args.first, false)
18
+ else
19
+ @callback.call(@accumulated, args.first, false, args[1])
20
+ end
17
21
  end
18
22
  super(args.first)
19
23
  end
@@ -30,7 +34,11 @@ module NanoBot
30
34
  rewind
31
35
 
32
36
  if @callback
33
- @callback.call(@accumulated, nil, true)
37
+ if @callback.arity == 3
38
+ @callback.call(@accumulated, nil, true)
39
+ else
40
+ @callback.call(@accumulated, nil, true, nil)
41
+ end
34
42
  @callback = nil
35
43
  @accumulated = nil
36
44
  end
@@ -2,7 +2,7 @@
2
2
  services:
3
3
  nano-bots:
4
4
  image: ruby:3.2.2-slim-bookworm
5
- command: sh -c "apt-get update && apt-get install -y --no-install-recommends build-essential libffi-dev libsodium-dev lua5.4-dev curl && curl -s https://raw.githubusercontent.com/babashka/babashka/master/install | bash && gem install nano-bots -v 1.1.0 && bash"
5
+ command: sh -c "apt-get update && apt-get install -y --no-install-recommends build-essential libffi-dev libsodium-dev lua5.4-dev curl && curl -s https://raw.githubusercontent.com/babashka/babashka/master/install | bash && gem install nano-bots -v 1.1.2 && bash"
6
6
  environment:
7
7
  OPENAI_API_ADDRESS: https://api.openai.com
8
8
  OPENAI_API_KEY: your-access-token
data/static/gem.rb CHANGED
@@ -3,13 +3,13 @@
3
3
  module NanoBot
4
4
  GEM = {
5
5
  name: 'nano-bots',
6
- version: '1.1.0',
6
+ version: '1.1.2',
7
7
  author: 'icebaker',
8
8
  summary: 'Ruby Implementation of Nano Bots: small, AI-powered bots',
9
9
  description: 'Ruby Implementation of Nano Bots: small, AI-powered bots easily shared as a single file, designed to support multiple providers such as Vicuna, OpenAI ChatGPT, Google PaLM, Alpaca, and LLaMA.',
10
10
  github: 'https://github.com/icebaker/ruby-nano-bots',
11
11
  gem_server: 'https://rubygems.org',
12
12
  license: 'MIT',
13
- ruby: '3.1.4'
13
+ ruby: '3.1.0'
14
14
  }.freeze
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nano-bots
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - icebaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-07 00:00:00.000000000 Z
11
+ date: 2023-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: babosa
@@ -243,14 +243,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
243
  requirements:
244
244
  - - ">="
245
245
  - !ruby/object:Gem::Version
246
- version: 3.1.4
246
+ version: 3.1.0
247
247
  required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  requirements:
249
249
  - - ">="
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  requirements: []
253
- rubygems_version: 3.4.22
253
+ rubygems_version: 3.3.3
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: 'Ruby Implementation of Nano Bots: small, AI-powered bots'