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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e3f7b60a9ac9e53b673390eb9a81a1607fc47890325e80dc659ce2050756f73
4
- data.tar.gz: 818318dd86e9bb1b2e0b39492196cf1b1bc3e86095b94ab2bca7546cca8a8998
3
+ metadata.gz: fe30e7df4593043b52234d32cfe2848615fa4c26fa590a64780ee4d0aa29f627
4
+ data.tar.gz: 303afd5cef796cb1483d2e76f5012e7c833a3cf78e693d1a8239202bc04b0a15
5
5
  SHA512:
6
- metadata.gz: ceeb35b06b858251cb880e4041e355df5fae35ad444658d2285e3f281870884e7773d2249fc88545b5db28604a14139f2baf74fc0d2c4480d6308c05e24a49b4
7
- data.tar.gz: 17ffe3062ce9108fc83cad218aa461b9a68bca0b7e97c77aa3ed4e2f4dec388bf25a7bf06ec217f0e1dd19fcdab77921b7109ff0103ec22696536c1a26ae003b
6
+ metadata.gz: 73358e42395834bedd7a06bf7b8f19e81e11121e098f94fe58ad4c6165c81b22f5789752e1b8e182aed17f507aeace5267c08a9c3817d7e2d2df616fc1f5ad6f
7
+ data.tar.gz: d0ce88dce23d20cd23bcf3cf8d6c436ccc22360c691f768e59208c99829b36886466fa3b1ed39b62e844de41d957425e7680d13c761b6c5767429e3fcd9b5c5c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.2] - 2024-07-30
4
+
5
+ - Friendly I18n
6
+
3
7
  ## [0.3.0] - 2024-07-30
4
8
 
5
9
  - on_inner_monologue: ->(text:) { puts Rainbow("monologue: #{text}").yellow }
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
- I18n.load_path += Dir[File.expand_path("locales") + "/*.yml"] # only for pure Ruby
32
- I18n.default_locale = :en # only for pure Ruby
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
- require 'i18n'
5
- I18n.load_path += Dir["#{File.expand_path('.oxaiworkers-local/locales')}/*.yml"]
6
- I18n.default_locale = :en
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 "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/present_compat.rb"
12
- require_relative "oxaiworkers/module_request.rb"
13
- require_relative "oxaiworkers/state_helper.rb"
14
- require_relative "oxaiworkers/state_batch.rb"
15
- require_relative "oxaiworkers/state_tools.rb"
16
- require_relative "oxaiworkers/tool_definition.rb"
17
- require_relative "oxaiworkers/delayed_request.rb"
18
- require_relative "oxaiworkers/dependency_helper.rb"
19
- require_relative "oxaiworkers/iterator.rb"
20
- require_relative "oxaiworkers/request.rb"
21
- require_relative "oxaiworkers/tool/eval.rb"
22
- require_relative "oxaiworkers/version.rb"
23
-
24
- require_relative "oxaiworkers/assistant/module_base.rb"
25
- require_relative "oxaiworkers/assistant/sysop.rb"
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 = "gpt-4o-mini"
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
- attr_writer :access_token
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{|c|
44
+ [Array, NilClass, String, Symbol, Hash].each do |c|
46
45
  c.send(:include, OxAiWorkers::PresentCompat) unless c.method_defined?(:present?)
47
- }
48
- String.send(:include, OxAiWorkers::CamelizeCompat) unless String.method_defined?(:camelize)
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
 
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'i18n'
4
+ I18n.load_path += Dir["#{File.expand_path('../../locales', __dir__)}/*.yml"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.2'
5
5
  end
@@ -0,0 +1,5 @@
1
+ en:
2
+ oxaiworkers:
3
+ assistant:
4
+ sysop:
5
+ role: "You are a software agent inside my computer"
@@ -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"
@@ -0,0 +1,10 @@
1
+ en:
2
+ oxaiworkers:
3
+ tool:
4
+ eval:
5
+ ruby:
6
+ description: "Execute Ruby code and return the result of the last expression"
7
+ input: "Ruby source code"
8
+ sh:
9
+ description: "Execute a sh command and get the result (stdout + stderr)"
10
+ input: "Source command"
@@ -0,0 +1,5 @@
1
+ ru:
2
+ oxaiworkers:
3
+ assistant:
4
+ sysop:
5
+ role: Ты программный агент внутри моего компьютера
@@ -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: Ты программный агент внутри моего компьютера
@@ -0,0 +1,10 @@
1
+ ru:
2
+ oxaiworkers:
3
+ tool:
4
+ eval:
5
+ ruby:
6
+ description: Выполнить код на ruby и вернуть результат последней строки
7
+ input: Исходный код на Ruby
8
+ sh:
9
+ description: Выполнить sh-команду и получить результат (stdout + stderr)
10
+ input: Исходная команда
data/template/start CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'i18n'
5
- I18n.load_path += Dir["#{File.expand_path('.oxaiworkers-local/locales')}/*.yml"]
6
- I18n.default_locale = :en
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.0
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.system.yml
140
- - locales/ru.system.yml
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