ox-ai-workers 0.7.2 → 0.7.4

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: acc49f031b04f7f46a59bbeb85fbaf8ec6ede063d6c18c62f07318f00c34da0c
4
- data.tar.gz: 3de498797605eacfc2cd5a0c22883d0c7f1be83261e60588284ce197a8008615
3
+ metadata.gz: 3838e126219f836dadf449f3a2f62c4ffc298df002b100e3249ac3281568858a
4
+ data.tar.gz: '09ae1592f862b982d74c579d9f14f4873f3a8a434f9cdb1300d524673d45ad8d'
5
5
  SHA512:
6
- metadata.gz: 395735eb349fa0683f7b78bee1404bb63499945c0eb7e83a34cc293447bf7ea35c05ca196f220b0d793d4406611ad8e4eb25bf58435ca5fc0fbede29344a8e13
7
- data.tar.gz: 3e726089eeea1ab240da574bbfab8cdf3d6377a2c695f47ae97f344e9f37a0f7df73fbc6d544f10e7204b001abde17691a289ce20475ef0905d8ab4795995ec4
6
+ metadata.gz: af412ce5edd9468958f054a7fbe7646dc5d4daa77473f31cb2f83d5cea009066005bf4f54f3e5cbe091a2dfd646e3c45bca366a64252afcb5746cef6a0f304de
7
+ data.tar.gz: 3ab249b4ebd3bf6961ed1e56209abded50a2111620a2dd3b46508f14f6b45f8b36e12af52abb9a8ae2ae0456a0b8f14fc649b937a83b6e2627da11dcc6821688
data/CHANGELOG.md CHANGED
@@ -1,18 +1,26 @@
1
- ## [0.7.1] - 2024-08-024
1
+ ## [0.7.4] - 2024-08-25
2
+
3
+ - Fixed `finish_it` for `Iterator`
4
+
5
+ ## [0.7.2] - 2024-08-25
6
+
7
+ - Fixed tool calls in `Iterator`
8
+
9
+ ## [0.7.1] - 2024-08-24
2
10
 
3
11
  - Added retry for `Iterator`
4
12
 
5
- ## [0.7.0] - 2024-08-024
13
+ ## [0.7.0] - 2024-08-24
6
14
 
7
15
  - Added `finish` for `Iterator`
8
16
  - Added `after_finish` for `Iterator`
9
17
 
10
- ## [0.6.3] - 2024-08-024
18
+ ## [0.6.3] - 2024-08-24
11
19
 
12
20
  - Added `add_raw_context` for `Iterator`
13
21
  - Fixed `requested?`
14
22
 
15
- ## [0.6.2] - 2024-08-024
23
+ ## [0.6.2] - 2024-08-24
16
24
 
17
25
  - Rails ActiveRecord support
18
26
 
@@ -14,10 +14,12 @@ en:
14
14
  description: The function saves key facts, nuances, and actions from previous messages, including the provided response. After calling this function, all previous messages will be deleted. Use it only after all intermediate steps are completed and when the exact content of previous messages is no longer relevant.
15
15
  text: Enumeration of important facts and nuances
16
16
  result: Messages deleted
17
+ finish_it:
18
+ description: Function to complete steps
17
19
  monologue:
18
20
  - Step %d. Develop your own solution to the problem, taking initiative and making assumptions.
19
21
  - Step %d. Enclose all your developments from the previous step in the ox_ai_workers_iterator__inner_monologue function.
20
22
  - Step %d. Call the necessary functions one after another until the desired result is achieved.
21
23
  - Step %d. When all intermediate steps are completed and the exact content of previous messages is no longer relevant, use the ox_ai_workers_iterator__summarize function.
22
24
  - Step %d. When the solution is ready, notify about it and wait for the user's response.
23
- - Step %d. In the end, call the ox_ai_workers_iterator__finish function.
25
+ - Step %d. In the end, call the ox_ai_workers_iterator__finish_it function.
@@ -14,12 +14,12 @@ ru:
14
14
  description: Функция сохраняет ключевые факты, нюансы и действия из предыдущих сообщений, включая предоставленный ответ. После вызова этой функции все предыдущие сообщения будут удалены. Используйте её только после завершения всех промежуточных шагов и когда точное содержание предыдущих сообщений больше не имеет значения.
15
15
  text: Перечисление важных фактов и нюансов
16
16
  result: Сообщения удалены
17
- finish:
18
- description: Функция для завершения шагов.
17
+ finish_it:
18
+ description: Функция для завершения шагов
19
19
  monologue:
20
20
  - Шаг %d. Разработай собственное решение проблемы, проявляй инициативу и делай предположения.
21
21
  - Шаг %d. Заключи все свои наработки из предыдущего шага в функцию ox_ai_workers_iterator__inner_monologue.
22
- - Шаг %d. Вызывай необходимые функции друг за другом, пока желаемый результат не будет достигнут.
22
+ - Шаг %d. Вызывай необходимые функции друг за другом, пока результат не будет достигнут.
23
23
  - Шаг %d. Когда все промежуточные шаги завершены и точное содержание предыдущих сообщений больше не имеет значения, используй функцию ox_ai_workers_iterator__summarize.
24
24
  - Шаг %d. Когда решение готово, сообщи об этом с помощью функции ox_ai_workers_iterator__action_request и ожидай ответ пользователя.
25
- - Шаг %d. В конце вызови функцию ox_ai_workers_iterator__finish.
25
+ - Шаг %d. В конце вызови функцию ox_ai_workers_iterator__finish_it.
@@ -2,7 +2,7 @@
2
2
 
3
3
  module OxAiWorkers
4
4
  class Iterator < OxAiWorkers::StateTools
5
- ITERATOR_FUNCTIONS = %i[inner_monologue outer_voice action_request summarize].freeze
5
+ ITERATOR_FUNCTIONS = %i[inner_monologue outer_voice action_request summarize finish_it].freeze
6
6
 
7
7
  include OxAiWorkers::ToolDefinition
8
8
  include OxAiWorkers::LoadI18n
@@ -34,7 +34,7 @@ module OxAiWorkers
34
34
  property :text, type: 'string', description: I18n.t('oxaiworkers.iterator.summarize.text'), required: true
35
35
  end
36
36
 
37
- define_function :finish, description: I18n.t('oxaiworkers.iterator.finish.description')
37
+ define_function :finish_it, description: I18n.t('oxaiworkers.iterator.finish_it.description')
38
38
 
39
39
  @monologue = steps || I18n.t('oxaiworkers.iterator.monologue')
40
40
  end
@@ -102,7 +102,7 @@ module OxAiWorkers
102
102
  nil
103
103
  end
104
104
 
105
- def finish
105
+ def finish_it
106
106
  complete! if can_complete?
107
107
  @after_finish&.call
108
108
  nil
@@ -185,12 +185,6 @@ module OxAiWorkers
185
185
  OxAiWorkers.logger.warn "Iterator::ServerError #{e.message}. Waiting 10 seconds..."
186
186
  sleep(10)
187
187
  external_request
188
- # rescue Faraday::ForbiddenError => e
189
- # OxAiWorkers.logger.error "Iterator::ForbiddenError #{e.inspect}", for: self.class
190
- # rescue StandardError => e
191
- # OxAiWorkers.logger.error "Iterator::StandardError #{e.inspect}", for: self.class
192
- # rescue OpenAI::Error => e
193
- # OxAiWorkers.logger.error "Iterator::OpenAI::Error #{e.inspect}", for: self.class
194
188
  end
195
189
 
196
190
  def tick_or_wait
@@ -212,7 +206,6 @@ module OxAiWorkers
212
206
  return unless requested?
213
207
 
214
208
  sleep(60) unless ticker
215
- analyze!
216
209
  end
217
210
 
218
211
  def process_result(_transition)
@@ -3,7 +3,7 @@
3
3
  module OxAiWorkers
4
4
  module StateHelper
5
5
  def log_me(transition)
6
- # OxAiWorkers.logger.debug("`#{transition.event}` was called to transition from :#{transition.from} to :#{transition.to}")
6
+ # OxAiWorkers.logger.info("`#{transition.event}` was called to transition from :#{transition.from} to :#{transition.to}")
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '0.7.2'
4
+ VERSION = '0.7.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox-ai-workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-25 00:00:00.000000000 Z
11
+ date: 2024-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize