nano-bots 0.1.0 → 0.1.1
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/README.md +6 -6
- data/components/adapter.rb +10 -2
- data/docker-compose.example.yml +3 -3
- data/static/gem.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acc012feeff1090abe2df65283bdd02c8eb1c44bdb5cad13a91ce5dc481727a8
|
4
|
+
data.tar.gz: b34a3d078c723494e12bfcdf6793294d400adbe5150302d675eef569d471ff37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 617b3fda80392476c1943f3df9e5201d1cd5f377ede9b76b413748ca4197834b7058f4b48abc599af4eddff0879e111f7860a403759eda34cdcc3894f8d865e8
|
7
|
+
data.tar.gz: 7907c44f88d19ea62e57b1288410f80045438c4ba7a9bc962fe07cb4535467b88aea43e618e5165971403e2ac30d16c52a0cf56077916bbb5082d0cee4945892
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -28,13 +28,13 @@ https://user-images.githubusercontent.com/113217272/238141567-c58a240c-7b67-4b3b
|
|
28
28
|
For a system usage:
|
29
29
|
|
30
30
|
```sh
|
31
|
-
gem install nano-bots -v 0.1.
|
31
|
+
gem install nano-bots -v 0.1.1
|
32
32
|
```
|
33
33
|
|
34
34
|
To use it in a project, add it to your `Gemfile`:
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
gem 'nano-bots', '~> 0.1.
|
37
|
+
gem 'nano-bots', '~> 0.1.1'
|
38
38
|
```
|
39
39
|
|
40
40
|
```sh
|
@@ -85,15 +85,15 @@ version: '3.7'
|
|
85
85
|
services:
|
86
86
|
nano-bots:
|
87
87
|
image: ruby:3.2.2-slim-bullseye
|
88
|
-
command: sh -c "gem install nano-bots -v 0.1.
|
88
|
+
command: sh -c "gem install nano-bots -v 0.1.1 && bash"
|
89
89
|
environment:
|
90
90
|
OPENAI_API_ADDRESS: https://api.openai.com
|
91
91
|
OPENAI_API_KEY: your-access-token
|
92
92
|
NANO_BOTS_ENCRYPTION_PASSWORD: UNSAFE
|
93
93
|
NANO_BOTS_END_USER: your-user
|
94
94
|
volumes:
|
95
|
-
- ./your-cartridges
|
96
|
-
- ./your-state
|
95
|
+
- ./your-cartridges:/root/.local/share/nano-bots/cartridges
|
96
|
+
- ./your-state-path:/root/.local/state/nano-bots
|
97
97
|
```
|
98
98
|
|
99
99
|
Enter the container:
|
@@ -408,5 +408,5 @@ gem build nano-bots.gemspec
|
|
408
408
|
|
409
409
|
gem signin
|
410
410
|
|
411
|
-
gem push nano-bots-0.1.
|
411
|
+
gem push nano-bots-0.1.1.gem
|
412
412
|
```
|
data/components/adapter.rb
CHANGED
@@ -24,14 +24,22 @@ module NanoBot
|
|
24
24
|
def self.fennel(content, expression)
|
25
25
|
path = "#{File.expand_path('../static/fennel', __dir__)}/?.lua"
|
26
26
|
state = SweetMoon::State.new(package_path: path).fennel
|
27
|
-
|
27
|
+
# TODO: global is deprecated...
|
28
|
+
state.fennel.eval(
|
29
|
+
"(global adapter (fn [content] #{expression}))", 1,
|
30
|
+
{ allowedGlobals: %w[math string table] }
|
31
|
+
)
|
28
32
|
adapter = state.get(:adapter)
|
29
33
|
adapter.call([content])
|
30
34
|
end
|
31
35
|
|
32
36
|
def self.lua(content, expression)
|
33
37
|
state = SweetMoon::State.new
|
34
|
-
|
38
|
+
code = "_, adapter = pcall(load('return function(content) return #{
|
39
|
+
expression.gsub("'", "\\\\'")
|
40
|
+
}; end', nil, 't', {math=math,string=string,table=table}))"
|
41
|
+
|
42
|
+
state.eval(code)
|
35
43
|
adapter = state.get(:adapter)
|
36
44
|
adapter.call([content])
|
37
45
|
end
|
data/docker-compose.example.yml
CHANGED
@@ -3,12 +3,12 @@ version: '3.7'
|
|
3
3
|
services:
|
4
4
|
nano-bots:
|
5
5
|
image: ruby:3.2.2-slim-bullseye
|
6
|
-
command: sh -c "apt-get update && apt-get install -y --no-install-recommends build-essential libffi-dev libsodium-dev lua5.4-dev && gem install nano-bots -v 0.1.
|
6
|
+
command: sh -c "apt-get update && apt-get install -y --no-install-recommends build-essential libffi-dev libsodium-dev lua5.4-dev && gem install nano-bots -v 0.1.1 && bash"
|
7
7
|
environment:
|
8
8
|
OPENAI_API_ADDRESS: https://api.openai.com
|
9
9
|
OPENAI_API_KEY: your-access-token
|
10
10
|
NANO_BOTS_ENCRYPTION_PASSWORD: UNSAFE
|
11
11
|
NANO_BOTS_END_USER: your-user
|
12
12
|
volumes:
|
13
|
-
- ./your-cartridges
|
14
|
-
- ./your-state
|
13
|
+
- ./your-cartridges:/root/.local/share/nano-bots/cartridges
|
14
|
+
- ./your-state-path:/root/.local/state/nano-bots
|
data/static/gem.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module NanoBot
|
4
4
|
GEM = {
|
5
5
|
name: 'nano-bots',
|
6
|
-
version: '0.1.
|
6
|
+
version: '0.1.1',
|
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.',
|