ox-ai-workers 0.2.4 → 0.2.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -3
- data/lib/oxaiworkers/version.rb +1 -1
- data/template/my_assistant.rb +1 -1
- data/template/tools/my_tool.rb +6 -4
- 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: 344c37f9e68f279cdbc7e84247ba973c57e7d3c635de4178c1c6ae48c503cf10
|
4
|
+
data.tar.gz: a1bd748d4d078c9f911549f9a0d02be9dd3ce2c02cdaac13b10eb048fe23881f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78703cebb3370c3ca967346e77f5816720a824ebefb9170d304add87aa7e4cbb1f54f7f2904bbf11e8bed5030730f24e6f9b40ea7ff59126968c70d43960ffd1
|
7
|
+
data.tar.gz: 7331e973af417507cc7c2232080b104a4d0e173eb7c1117513089374b648a3f759b31b8cffa2c1f0bb551178f63f169e7a81c2e4134381f50df5c3a95998bd3c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -131,15 +131,17 @@ As a worker, you can use different classes depending on your needs:
|
|
131
131
|
oxaiworkers init
|
132
132
|
```
|
133
133
|
|
134
|
-
|
134
|
+
This will create a `.oxaiworkers-local` directory with the necessary initial settings.
|
135
|
+
|
136
|
+
Additionally, you can initialize a more comprehensive example using the command:
|
135
137
|
|
136
138
|
```sh
|
137
139
|
oxaiworkers init full
|
138
140
|
```
|
139
141
|
|
140
|
-
|
142
|
+
After this, in the `my_assistant.rb` file, you can find an example of an assistant that uses a tool from the `tools/my_tool.rb` file. In the `start` file, you will find the algorithm for applying this assistant.
|
141
143
|
|
142
|
-
3. Modify the
|
144
|
+
3. Modify the code as needed and run:
|
143
145
|
|
144
146
|
```sh
|
145
147
|
.oxaiworkers-local/start
|
data/lib/oxaiworkers/version.rb
CHANGED
data/template/my_assistant.rb
CHANGED
@@ -8,7 +8,7 @@ class MyAssistant
|
|
8
8
|
def initialize(delayed: false, model: nil)
|
9
9
|
@iterator = OxAiWorkers::Iterator.new(
|
10
10
|
worker: initWorker(delayed: delayed, model: model),
|
11
|
-
role: 'You are a
|
11
|
+
role: 'You are a software agent inside my computer',
|
12
12
|
tools: [MyTool.new]
|
13
13
|
)
|
14
14
|
end
|
data/template/tools/my_tool.rb
CHANGED
@@ -4,11 +4,13 @@ class MyTool
|
|
4
4
|
extend OxAiWorkers::ToolDefinition
|
5
5
|
include OxAiWorkers::DependencyHelper
|
6
6
|
|
7
|
-
define_function :
|
8
|
-
property :
|
7
|
+
define_function :sh, description: 'Execute a sh command and get the result (stdout + stderr)' do
|
8
|
+
property :input, type: 'string', description: 'Source command', required: true
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
puts "
|
11
|
+
def sh(input:)
|
12
|
+
puts "Executing sh: \"#{input}\""
|
13
|
+
stdout_and_stderr_s, = Open3.capture2e(input)
|
14
|
+
stdout_and_stderr_s
|
13
15
|
end
|
14
16
|
end
|