ox-ai-workers 0.5.5.1 → 0.5.6
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 +88 -12
- data/exe/oxaiworkers +9 -0
- data/lib/oxaiworkers/assistant/coder.rb +6 -0
- data/lib/oxaiworkers/tool/eval.rb +1 -1
- data/lib/oxaiworkers/version.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: 6f6d50356df9fac9b6a2497737e46f2b478051fa9e1c524bde5047c06c38b07b
|
4
|
+
data.tar.gz: 7577169961cd5b1720b697c7751d9560a73415e52bfdba4f889dca695b7c9db7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35702e04879dcffc1f87f0224df17c251983ddae5c8915264d5ae5df0a2c254b8e9949bc7333b80125f05791e1ac21c5f5ce3106337db3da18646565d4b0243e
|
7
|
+
data.tar.gz: cbf4c76a447d52484c63afc4546589b4cf4098ad9b441cbb9e7eb7bf8297de011bb1eff5410fdfad57c3010619cb818fb53b8e67bf32f318fc86e995649ca948
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -184,25 +184,25 @@ As a worker, you can use different classes depending on your needs:
|
|
184
184
|
|
185
185
|
2. Initialize with the command:
|
186
186
|
|
187
|
-
```sh
|
188
|
-
oxaiworkers init
|
189
|
-
```
|
187
|
+
```sh
|
188
|
+
oxaiworkers init
|
189
|
+
```
|
190
190
|
|
191
|
-
This will create a `.oxaiworkers-local` directory with the necessary initial source code.
|
191
|
+
This will create a `.oxaiworkers-local` directory with the necessary initial source code.
|
192
192
|
|
193
|
-
Additionally, you can initialize a more comprehensive example using the command:
|
193
|
+
Additionally, you can initialize a more comprehensive example using the command:
|
194
194
|
|
195
|
-
```sh
|
196
|
-
oxaiworkers init full
|
197
|
-
```
|
195
|
+
```sh
|
196
|
+
oxaiworkers init full
|
197
|
+
```
|
198
198
|
|
199
|
-
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.
|
199
|
+
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.
|
200
200
|
|
201
201
|
3. Modify the code as needed and run:
|
202
202
|
|
203
|
-
```sh
|
204
|
-
.oxaiworkers-local/start
|
205
|
-
```
|
203
|
+
```sh
|
204
|
+
.oxaiworkers-local/start
|
205
|
+
```
|
206
206
|
|
207
207
|
## Logging
|
208
208
|
|
@@ -213,6 +213,82 @@ To show all log messages:
|
|
213
213
|
OxAiWorkers.logger.level = :debug
|
214
214
|
```
|
215
215
|
|
216
|
+
## Real World Examples
|
217
|
+
|
218
|
+
### Project: Python Snake Game
|
219
|
+
|
220
|
+
1. Create the project folder:
|
221
|
+
|
222
|
+
```sh
|
223
|
+
mkdir snake
|
224
|
+
cd snake
|
225
|
+
```
|
226
|
+
|
227
|
+
2. Initialize OxAiWorkers:
|
228
|
+
|
229
|
+
```sh
|
230
|
+
oxaiworkers init
|
231
|
+
```
|
232
|
+
|
233
|
+
3. Modify the file `.oxaiworkers-local/start`:
|
234
|
+
|
235
|
+
```ruby
|
236
|
+
# Replace
|
237
|
+
@assistant = OxAiWorkers::Assistant::Sysop.new
|
238
|
+
|
239
|
+
# With
|
240
|
+
@assistant = OxAiWorkers::Assistant::Coder.new(language: 'python')
|
241
|
+
```
|
242
|
+
|
243
|
+
4. Run the project:
|
244
|
+
|
245
|
+
```sh
|
246
|
+
.oxaiworkers-local/start
|
247
|
+
```
|
248
|
+
|
249
|
+
5. In the command prompt, type:
|
250
|
+
|
251
|
+
```sh
|
252
|
+
@assistant.task = "Write a snake game"
|
253
|
+
```
|
254
|
+
|
255
|
+
### Running System Operator in Any Directory
|
256
|
+
|
257
|
+
To run OxAiWorkers in any directory, execute the following command:
|
258
|
+
|
259
|
+
```sh
|
260
|
+
oxaiworkers run sysop
|
261
|
+
```
|
262
|
+
|
263
|
+
Alternatively, you can use IRB (Interactive Ruby):
|
264
|
+
|
265
|
+
1. Start IRB:
|
266
|
+
|
267
|
+
```sh
|
268
|
+
irb
|
269
|
+
```
|
270
|
+
|
271
|
+
2. In the console, enter the following commands:
|
272
|
+
|
273
|
+
```ruby
|
274
|
+
require 'ox-ai-workers'
|
275
|
+
@sysop = OxAiWorkers::Assistant::Sysop.new
|
276
|
+
```
|
277
|
+
|
278
|
+
Then set a task:
|
279
|
+
|
280
|
+
```ruby
|
281
|
+
@sysop.task = "Show all cron jobs."
|
282
|
+
```
|
283
|
+
|
284
|
+
After these steps you can interact with it using the following method:
|
285
|
+
|
286
|
+
```ruby
|
287
|
+
@sysop.add_response("Yes, I want it.")
|
288
|
+
```
|
289
|
+
|
290
|
+
or set a new task.
|
291
|
+
|
216
292
|
## Features
|
217
293
|
|
218
294
|
- **Generative Intelligence**: Leverages OpenAI's capabilities to enhance task execution.
|
data/exe/oxaiworkers
CHANGED
@@ -21,4 +21,13 @@ if ARGV.first == 'init'
|
|
21
21
|
puts "A #{dir} directory was created with the necessary initial settings."
|
22
22
|
puts "Modify the settings as needed and run: #{dir}/start"
|
23
23
|
end
|
24
|
+
elsif ARGV.first == 'run'
|
25
|
+
require 'irb'
|
26
|
+
require 'ox-ai-workers'
|
27
|
+
puts "#{ARGV.last.capitalize}: #{OxAiWorkers::VERSION}"
|
28
|
+
instance_variable_set("@#{ARGV.last}", Object.const_get("OxAiWorkers::Assistant::#{ARGV.last.capitalize}").new)
|
29
|
+
ARGV.clear
|
30
|
+
IRB.start
|
31
|
+
else
|
32
|
+
puts "Error: Unknown command: #{ARGV.first}"
|
24
33
|
end
|
@@ -18,6 +18,12 @@ module OxAiWorkers
|
|
18
18
|
on_summarize: ->(text:) { puts "summary: #{text}".colorize(:blue) }
|
19
19
|
)
|
20
20
|
end
|
21
|
+
|
22
|
+
def language=(language)
|
23
|
+
with_locale do
|
24
|
+
@iterator.role = format(I18n.t('oxaiworkers.assistant.coder.role'), language)
|
25
|
+
end
|
26
|
+
end
|
21
27
|
end
|
22
28
|
end
|
23
29
|
end
|
data/lib/oxaiworkers/version.rb
CHANGED