ox-ai-workers 1.1.2.11 → 1.1.2.12
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 704080bc78407750192bb2249b5ef0f5cbeedca9507ddb3baea55be6651e749d
|
4
|
+
data.tar.gz: 263201940715ffa90b444f578aac5b2506d9a112d848de26e3ebbd312e75add1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeaceeba70ed5ce6c628116fc739b100cbb5cead8702f92fb1e55cfa750a012f9b1dd9558870741fbe03f5a66a17388a06e47921609e4ccd0ed6d076c83e1382
|
7
|
+
data.tar.gz: 2a819f6f7ea6b780796a9b37fc9c19f75cdb49da3797f36972c3d5bca4db118c5b84e11e2bea3befa2d9178d1b5a43cb12ff5bb2074e37c53205f3b68d80f1ff
|
data/lib/oxaiworkers/iterator.rb
CHANGED
@@ -91,7 +91,7 @@ module OxAiWorkers
|
|
91
91
|
else
|
92
92
|
OxAiWorkers.logger.warn "Iterator::inner_monologue is not available: #{speach}"
|
93
93
|
end
|
94
|
-
|
94
|
+
speach
|
95
95
|
end
|
96
96
|
|
97
97
|
def outer_voice(text:)
|
@@ -103,7 +103,7 @@ module OxAiWorkers
|
|
103
103
|
inner_monologue(speach: text)
|
104
104
|
end
|
105
105
|
|
106
|
-
|
106
|
+
text
|
107
107
|
end
|
108
108
|
|
109
109
|
def finish_it
|
@@ -171,6 +171,7 @@ module OxAiWorkers
|
|
171
171
|
|
172
172
|
def next_iteration
|
173
173
|
@messages += @queue
|
174
|
+
OxAiWorkers.logger.warn "Iterator::Next iteration: #{@messages.count}/#{@queue.count}"
|
174
175
|
@queue = []
|
175
176
|
@worker.append(messages: @messages)
|
176
177
|
request!
|
@@ -245,8 +246,10 @@ module OxAiWorkers
|
|
245
246
|
iterate! if can_iterate?
|
246
247
|
end
|
247
248
|
result = @worker.result || @worker.errors
|
248
|
-
|
249
|
-
|
249
|
+
if result.present?
|
250
|
+
OxAiWorkers.logger.warn "Iterator::No tool calls: #{result}"
|
251
|
+
outer_voice text: result
|
252
|
+
end
|
250
253
|
end
|
251
254
|
|
252
255
|
def complete_iteration
|
@@ -41,12 +41,14 @@ module OxAiWorkers
|
|
41
41
|
@messages.each do |message|
|
42
42
|
content = message[:content]
|
43
43
|
if content.is_a?(String)
|
44
|
-
OxAiWorkers.logger.
|
44
|
+
OxAiWorkers.logger.warn "Request (String)[#{message[:role]}]: #{content.truncate(500)}"
|
45
45
|
elsif content.is_a?(Array)
|
46
|
-
types = content.map
|
47
|
-
|
46
|
+
types = content.map do |item|
|
47
|
+
"#{item[:type]}: #{item[:content]&.truncate(500)} #{item[:input]&.truncate(500)}"
|
48
|
+
end.compact.join(', ')
|
49
|
+
OxAiWorkers.logger.warn "Request (Array): [#{types}]"
|
48
50
|
else
|
49
|
-
OxAiWorkers.logger.
|
51
|
+
OxAiWorkers.logger.warn "Request (Other): #{message.inspect}"
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
data/lib/oxaiworkers/version.rb
CHANGED