ox-ai-workers 0.5.0 → 0.5.1
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 +6 -0
- data/lib/oxaiworkers/iterator.rb +3 -3
- data/lib/oxaiworkers/tool/eval.rb +7 -3
- data/lib/oxaiworkers/tool/file_system.rb +8 -2
- 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: 1b3d80806db64371193199ae3e0731060a156fd08398628e68fdd0bae2fa459c
|
4
|
+
data.tar.gz: bd70e01c89c093a85b2f32cf62b6de0826fff868378721e4203bfbc732998a63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 796005900f27745768ec4cb9467937aaad3cb2dd2cad6d76e8ae3fa1a0da29a32c596de8456d491b3c7fadfc2db9324369befbf120ceddfc1224bbb53cdba05b
|
7
|
+
data.tar.gz: 8d1fcf58fbaf734dab49276bec6fdd6f8aabddbe187c0a97495fe1ca767e5dfcdd09eb56069bfc3574712941fe3e7d77a1b2420ca7b294ef2a701b4d7deb1e5b
|
data/CHANGELOG.md
CHANGED
data/lib/oxaiworkers/iterator.rb
CHANGED
@@ -30,7 +30,7 @@ module OxAiWorkers
|
|
30
30
|
@worker = worker
|
31
31
|
@tools = [self] + tools
|
32
32
|
@role = role
|
33
|
-
@context =
|
33
|
+
@context = []
|
34
34
|
@monologue = I18n.t('oxaiworkers.iterator.monologue')
|
35
35
|
|
36
36
|
@on_inner_monologue = on_inner_monologue
|
@@ -80,7 +80,7 @@ module OxAiWorkers
|
|
80
80
|
@messages = []
|
81
81
|
@worker.finish
|
82
82
|
rebuild_worker
|
83
|
-
complete! if can_complete?
|
83
|
+
# complete! if can_complete?
|
84
84
|
@on_pack_history&.call(text: text)
|
85
85
|
nil
|
86
86
|
end
|
@@ -176,7 +176,7 @@ module OxAiWorkers
|
|
176
176
|
end
|
177
177
|
|
178
178
|
def valid?
|
179
|
-
@messages.
|
179
|
+
@messages.present? || @milestones.present?
|
180
180
|
end
|
181
181
|
end
|
182
182
|
end
|
@@ -23,10 +23,14 @@ module OxAiWorkers
|
|
23
23
|
|
24
24
|
def sh(input:)
|
25
25
|
puts Rainbow("Executing sh: \"#{input}\"").red
|
26
|
-
|
27
|
-
|
26
|
+
begin
|
27
|
+
stdout_and_stderr_s, status = Open3.capture2e(input)
|
28
|
+
return stdout_and_stderr_s if stdout_and_stderr_s.present?
|
28
29
|
|
29
|
-
|
30
|
+
status.to_s
|
31
|
+
rescue StandardError => e
|
32
|
+
e.message
|
33
|
+
end
|
30
34
|
end
|
31
35
|
end
|
32
36
|
end
|
@@ -39,14 +39,20 @@ module OxAiWorkers
|
|
39
39
|
|
40
40
|
def list_directory(directory_path:)
|
41
41
|
puts Rainbow("Listing directory: #{directory_path}").magenta
|
42
|
-
Dir.entries(directory_path)
|
42
|
+
list = Dir.entries(directory_path)
|
43
|
+
list.delete_if { |f| f.start_with?('.') }
|
44
|
+
if list.present?
|
45
|
+
"Contents of directory \"#{directory_path}\":\n #{list.join("\n")}"
|
46
|
+
else
|
47
|
+
"Directory is empty: #{directory_path}"
|
48
|
+
end
|
43
49
|
rescue Errno::ENOENT
|
44
50
|
"No such directory: #{directory_path}"
|
45
51
|
end
|
46
52
|
|
47
53
|
def read_file(file_path:)
|
48
54
|
puts Rainbow("Reading file: #{file_path}").magenta
|
49
|
-
if File.binary?(
|
55
|
+
if File.binary?(file_path)
|
50
56
|
"File is binary: #{file_path}"
|
51
57
|
else
|
52
58
|
File.read(file_path).to_s
|
data/lib/oxaiworkers/version.rb
CHANGED