ox-ai-workers 0.3.0 → 0.3.2
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 +3 -2
- data/exe/oxaiworkers +0 -1
- data/exe/start +3 -3
- data/lib/ox-ai-workers.rb +28 -34
- data/lib/oxaiworkers/load_i18n.rb +4 -0
- data/lib/oxaiworkers/version.rb +1 -1
- data/locales/en.assistant.yml +5 -0
- data/locales/{en.system.yml → en.iterator.yml} +0 -11
- data/locales/en.tool.yml +10 -0
- data/locales/ru.assistant.yml +5 -0
- data/locales/{ru.system.yml → ru.iterator.yml} +0 -11
- data/locales/ru.tool.yml +10 -0
- data/template/start +5 -5
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe30e7df4593043b52234d32cfe2848615fa4c26fa590a64780ee4d0aa29f627
|
4
|
+
data.tar.gz: 303afd5cef796cb1483d2e76f5012e7c833a3cf78e693d1a8239202bc04b0a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73358e42395834bedd7a06bf7b8f19e81e11121e098f94fe58ad4c6165c81b22f5789752e1b8e182aed17f507aeace5267c08a9c3817d7e2d2df616fc1f5ad6f
|
7
|
+
data.tar.gz: d0ce88dce23d20cd23bcf3cf8d6c436ccc22360c691f768e59208c99829b36886466fa3b1ed39b62e844de41d957425e7680d13c761b6c5767429e3fcd9b5c5c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -28,8 +28,9 @@ Here's a basic example of how to use OxAiWorkers:
|
|
28
28
|
|
29
29
|
```ruby
|
30
30
|
# Load localization files and set default locale
|
31
|
-
|
32
|
-
|
31
|
+
# Uncomment this if you want to change the locale
|
32
|
+
# require 'oxaiworkers/load_i18n' # only for pure Ruby
|
33
|
+
# I18n.default_locale = :ru # only for pure Ruby
|
33
34
|
|
34
35
|
# Require the main gem
|
35
36
|
require 'ox-ai-workers'
|
data/exe/oxaiworkers
CHANGED
@@ -14,7 +14,6 @@ if ARGV.first == 'init'
|
|
14
14
|
puts "Error: The #{dir} directory already exists."
|
15
15
|
else
|
16
16
|
FileUtils.mkdir_p "#{dir}/locales"
|
17
|
-
FileUtils.copy_entry "#{source}/locales", "#{dest}/locales"
|
18
17
|
if ARGV.last == 'full'
|
19
18
|
FileUtils.copy_entry "#{source}/template", dest.to_s
|
20
19
|
else
|
data/exe/start
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
I18n.default_locale = :
|
4
|
+
# Uncomment this if you want to change the locale
|
5
|
+
# require 'oxaiworkers/load_i18n'
|
6
|
+
# I18n.default_locale = :ru
|
7
7
|
|
8
8
|
# Start your code here
|
9
9
|
require 'ox-ai-workers'
|
data/lib/ox-ai-workers.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require_relative
|
11
|
-
require_relative
|
12
|
-
require_relative
|
13
|
-
require_relative
|
14
|
-
require_relative
|
15
|
-
require_relative
|
16
|
-
require_relative
|
17
|
-
require_relative
|
18
|
-
require_relative
|
19
|
-
require_relative
|
20
|
-
require_relative
|
21
|
-
require_relative
|
22
|
-
require_relative
|
23
|
-
|
24
|
-
require_relative
|
25
|
-
require_relative
|
3
|
+
require 'faraday'
|
4
|
+
require 'faraday/multipart'
|
5
|
+
require 'rainbow'
|
6
|
+
require 'openai'
|
7
|
+
require 'yaml'
|
8
|
+
require 'json'
|
9
|
+
|
10
|
+
require_relative 'oxaiworkers/version'
|
11
|
+
require_relative 'oxaiworkers/load_i18n'
|
12
|
+
require_relative 'oxaiworkers/present_compat'
|
13
|
+
require_relative 'oxaiworkers/module_request'
|
14
|
+
require_relative 'oxaiworkers/state_helper'
|
15
|
+
require_relative 'oxaiworkers/state_batch'
|
16
|
+
require_relative 'oxaiworkers/state_tools'
|
17
|
+
require_relative 'oxaiworkers/tool_definition'
|
18
|
+
require_relative 'oxaiworkers/delayed_request'
|
19
|
+
require_relative 'oxaiworkers/dependency_helper'
|
20
|
+
require_relative 'oxaiworkers/iterator'
|
21
|
+
require_relative 'oxaiworkers/request'
|
22
|
+
require_relative 'oxaiworkers/tool/eval'
|
23
|
+
|
24
|
+
require_relative 'oxaiworkers/assistant/module_base'
|
25
|
+
require_relative 'oxaiworkers/assistant/sysop'
|
26
26
|
|
27
27
|
module OxAiWorkers
|
28
|
-
DEFAULT_MODEL =
|
28
|
+
DEFAULT_MODEL = 'gpt-4o-mini'
|
29
29
|
DEFAULT_MAX_TOKEN = 4096
|
30
30
|
DEFAULT_TEMPERATURE = 0.7
|
31
31
|
|
@@ -33,8 +33,7 @@ module OxAiWorkers
|
|
33
33
|
class ConfigurationError < Error; end
|
34
34
|
|
35
35
|
class Configuration
|
36
|
-
|
37
|
-
attr_accessor :model, :max_tokens, :temperature
|
36
|
+
attr_accessor :model, :max_tokens, :temperature, :access_token
|
38
37
|
|
39
38
|
def initialize
|
40
39
|
@access_token = nil
|
@@ -42,15 +41,10 @@ module OxAiWorkers
|
|
42
41
|
@max_tokens = DEFAULT_MAX_TOKEN
|
43
42
|
@temperature = DEFAULT_TEMPERATURE
|
44
43
|
|
45
|
-
[Array, NilClass, String, Symbol, Hash].each
|
44
|
+
[Array, NilClass, String, Symbol, Hash].each do |c|
|
46
45
|
c.send(:include, OxAiWorkers::PresentCompat) unless c.method_defined?(:present?)
|
47
|
-
|
48
|
-
String.
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
def access_token
|
53
|
-
return @access_token
|
46
|
+
end
|
47
|
+
String.include OxAiWorkers::CamelizeCompat unless String.method_defined?(:camelize)
|
54
48
|
end
|
55
49
|
end
|
56
50
|
|
data/lib/oxaiworkers/version.rb
CHANGED
@@ -20,14 +20,3 @@ en:
|
|
20
20
|
- "Step 2.1: Interact with the user using the ox_ai_workers_iterator__outerVoice and ox_ai_workers_iterator__actionRequest functions during the process."
|
21
21
|
- "Step 3: When the solution is ready, report it using the ox_ai_workers_iterator__outerVoice function."
|
22
22
|
- "Step 4: Save facts, nuances, and actions using the ox_ai_workers_iterator__packHistory function."
|
23
|
-
tool:
|
24
|
-
eval:
|
25
|
-
ruby:
|
26
|
-
description: "Execute Ruby code and return the result of the last expression"
|
27
|
-
input: "Ruby source code"
|
28
|
-
sh:
|
29
|
-
description: "Execute a sh command and get the result (stdout + stderr)"
|
30
|
-
input: "Source command"
|
31
|
-
assistant:
|
32
|
-
sysop:
|
33
|
-
role: "You are a software agent inside my computer"
|
data/locales/en.tool.yml
ADDED
@@ -20,14 +20,3 @@ ru:
|
|
20
20
|
- Шаг 2.1. Во время работы используй функции ox_ai_workers_iterator__outerVoice и ox_ai_workers_iterator__actionRequest.
|
21
21
|
- Шаг 3. Когда решение готово, сообщи о нем с помощью функции ox_ai_workers_iterator__outerVoice
|
22
22
|
- Шаг 4. Сохрани факты, нюансы и действия с помощью функции ox_ai_workers_iterator__packHistory и предложи дальнейшие действия с помощью функции ox_ai_workers_iterator__actionRequest.
|
23
|
-
tool:
|
24
|
-
eval:
|
25
|
-
ruby:
|
26
|
-
description: Выполнить код на ruby и вернуть результат последней строки
|
27
|
-
input: Исходный код на Ruby
|
28
|
-
sh:
|
29
|
-
description: Выполнить sh-команду и получить результат (stdout + stderr)
|
30
|
-
input: Исходная команда
|
31
|
-
assistant:
|
32
|
-
sysop:
|
33
|
-
role: Ты программный агент внутри моего компьютера
|
data/locales/ru.tool.yml
ADDED
data/template/start
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
I18n.default_locale = :
|
7
|
-
|
8
|
-
# ### Start your code here
|
4
|
+
# Uncomment this if you want to change the locale
|
5
|
+
# require 'oxaiworkers/load_i18n'
|
6
|
+
# I18n.default_locale = :ru
|
9
7
|
|
10
8
|
# Required external gems
|
11
9
|
require 'ox-ai-workers'
|
12
10
|
require 'irb'
|
13
11
|
|
12
|
+
# ### Start your code here ###
|
13
|
+
|
14
14
|
# Required my libs
|
15
15
|
require_relative 'my_assistant'
|
16
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox-ai-workers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Smolev
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/oxaiworkers/delayed_request.rb
|
127
127
|
- lib/oxaiworkers/dependency_helper.rb
|
128
128
|
- lib/oxaiworkers/iterator.rb
|
129
|
+
- lib/oxaiworkers/load_i18n.rb
|
129
130
|
- lib/oxaiworkers/module_request.rb
|
130
131
|
- lib/oxaiworkers/present_compat.rb
|
131
132
|
- lib/oxaiworkers/request.rb
|
@@ -136,8 +137,12 @@ files:
|
|
136
137
|
- lib/oxaiworkers/tool_definition.rb
|
137
138
|
- lib/oxaiworkers/version.rb
|
138
139
|
- lib/ruby/ox-ai-workers.rb
|
139
|
-
- locales/en.
|
140
|
-
- locales/
|
140
|
+
- locales/en.assistant.yml
|
141
|
+
- locales/en.iterator.yml
|
142
|
+
- locales/en.tool.yml
|
143
|
+
- locales/ru.assistant.yml
|
144
|
+
- locales/ru.iterator.yml
|
145
|
+
- locales/ru.tool.yml
|
141
146
|
- template/my_assistant.rb
|
142
147
|
- template/start
|
143
148
|
- template/tools/my_tool.rb
|