ox-ai-workers 0.4.1 → 0.4.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: ec4ac0192d833a4e69e1fb10138d2668ea67d36aed5dd5de59b5a0046a08b38e
4
- data.tar.gz: f1de881044ac1389e781cb59816b2ea8f1c36d0c00340f770c486fb622467b9a
3
+ metadata.gz: 6c6a4642d2f20a5544eb56eb31b2ecb26a190565711f6257793fc5320f4c46ef
4
+ data.tar.gz: 480d67e601de4af89a947cb1951aa81ab04be079073cb6d50fc0b353e780300b
5
5
  SHA512:
6
- metadata.gz: 780a288aa72d7b548eb8ebe64067d7b79a5d354855f3f1912afa5843a3190c78d40803ca73d1a4be0aa95dab7ca26ad3fc72106642fd24d76a2a39dc3985617f
7
- data.tar.gz: 492959e288c68c01d786c5be0bd87ed88f6d6b77b9efa22a623d7283b6560dfa55a3e10f280f659502b158ec848da23f654560810fdfc9c6fa7af0272733152b
6
+ metadata.gz: 6dfbee661da05077107165b65130ef4540aec31e9bfd7b94052f6ce0e068de593651bdcedaae6e3cdebec289d4d9011ddc0da3a8445b0ea0bce52d797e2a7041
7
+ data.tar.gz: e915d590643c6db03154384e66def40bc3e8b8dd91965dade1c6f3706fc3a874bd7d54301a3de4120b25da8f80f363204b08d8172676750fcb9c6cc965d39e49
data/CHANGELOG.md CHANGED
@@ -1,8 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.4.1] - 2024-07-30
3
+ ## [0.4.2] - 2024-07-30
4
4
 
5
5
  - Binary reading is suppressed
6
+ - Command output code is returned if the command output is empty
6
7
 
7
8
  ## [0.4.0] - 2024-07-30
8
9
 
@@ -53,30 +53,30 @@ module OxAiWorkers
53
53
  end
54
54
 
55
55
  def innerMonologue(speach:)
56
- @queue.pop
57
- @queue << { role: :system, content: "#{__method__}: #{speach}" }
56
+ # @queue.pop
57
+ @queue << { role: :system, content: speach.to_s }
58
58
  @on_inner_monologue&.call(text: speach)
59
59
  nil
60
60
  end
61
61
 
62
62
  def outerVoice(text:)
63
- @queue.pop
64
- @queue << { role: :system, content: "#{__method__}: #{text}" }
63
+ # @queue.pop
64
+ @queue << { role: :system, content: text.to_s }
65
65
  @on_outer_voice&.call(text: text)
66
66
  nil
67
67
  end
68
68
 
69
69
  def actionRequest(action:)
70
70
  @result = action
71
- @queue.pop
72
- @messages << { role: :system, content: "#{__method__}: #{action}" }
71
+ # @queue.pop
72
+ @messages << { role: :system, content: action.to_s }
73
73
  complete! if can_complete?
74
74
  @on_action_request&.call(text: action)
75
75
  nil
76
76
  end
77
77
 
78
78
  def packHistory(text:)
79
- @milestones << "#{__method__}: #{text}"
79
+ @milestones << text.to_s
80
80
  @messages = []
81
81
  @worker.finish
82
82
  rebuildWorker
@@ -126,7 +126,7 @@ module OxAiWorkers
126
126
  puts "call: #{__method__} state: #{state_name}"
127
127
  @result = @worker.result || @worker.errors
128
128
  if @worker.tool_calls.present?
129
- @queue << { role: :system, content: @worker.tool_calls_raw.to_s }
129
+ @queue << { role: :assistant, content: @worker.tool_calls_raw.to_s }
130
130
  @worker.tool_calls.each do |external_call|
131
131
  tool = @tools.select do |t|
132
132
  t.class.tool_name == external_call[:class] && t.respond_to?(external_call[:name])
@@ -23,8 +23,10 @@ module OxAiWorkers
23
23
 
24
24
  def sh(input:)
25
25
  puts Rainbow("Executing sh: \"#{input}\"").red
26
- stdout_and_stderr_s, = Open3.capture2e(input)
27
- stdout_and_stderr_s
26
+ stdout_and_stderr_s, status = Open3.capture2e(input)
27
+ return stdout_and_stderr_s if stdout_and_stderr_s.present?
28
+
29
+ status.to_s
28
30
  end
29
31
  end
30
32
  end
@@ -12,6 +12,7 @@ module OxAiWorkers
12
12
  #
13
13
  class FileSystem
14
14
  extend OxAiWorkers::ToolDefinition
15
+ include OxAiWorkers::DependencyHelper
15
16
 
16
17
  define_function :list_directory,
17
18
  description: I18n.t('oxaiworkers.tool.file_system.list_directory.description') do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '0.4.1'
4
+ VERSION = '0.4.2'
5
5
  end
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.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev