omniai 3.1.2 → 3.2.0
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/lib/omniai/chat/message.rb +5 -0
- data/lib/omniai/chat/response.rb +1 -1
- data/lib/omniai/chat/tool_call_list.rb +5 -0
- data/lib/omniai/chat.rb +6 -1
- data/lib/omniai/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: 8d7dc6f3dc47d5f0385f1f3cc26c509364c55c42bd6290a40a4616c16e69eb66
|
|
4
|
+
data.tar.gz: 6b6bb6cddbcdcb699495d23137127e3f90fedd2ef179db0a504b2290ff09f1f8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c0a4f6a44bb5d205cda589cb1c85be12921ba1ff8fa9ef0c056b9071af05555db2cd872116597197805a43ac731afeee50925d9643546b9f77150a3465f2d06
|
|
7
|
+
data.tar.gz: ccb72e06a11d9eb6b2f4059b95130afea945aaddacd1f90bc357670a5f052ff93d4b3fbf48612caf5e6c228ad5b9802384913f888558b8a6df3167f0d08db6b1
|
data/lib/omniai/chat/message.rb
CHANGED
data/lib/omniai/chat/response.rb
CHANGED
|
@@ -81,7 +81,7 @@ module OmniAI
|
|
|
81
81
|
|
|
82
82
|
# @return [ToolCallList, nil]
|
|
83
83
|
def tool_call_list
|
|
84
|
-
tool_call_lists = messages.map(&:tool_call_list)
|
|
84
|
+
tool_call_lists = messages.filter(&:tool_call_list?).map(&:tool_call_list)
|
|
85
85
|
return if tool_call_lists.empty?
|
|
86
86
|
|
|
87
87
|
tool_call_lists.reduce(&:+)
|
data/lib/omniai/chat.rb
CHANGED
|
@@ -112,7 +112,7 @@ module OmniAI
|
|
|
112
112
|
raise SSLError, e.message, cause: e
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
if
|
|
115
|
+
if tools? && completion.tool_call_list?
|
|
116
116
|
spawn!(
|
|
117
117
|
@prompt.dup.tap do |prompt|
|
|
118
118
|
prompt.messages += completion.messages
|
|
@@ -126,6 +126,11 @@ module OmniAI
|
|
|
126
126
|
|
|
127
127
|
protected
|
|
128
128
|
|
|
129
|
+
# @return [Boolean]
|
|
130
|
+
def tools?
|
|
131
|
+
@tools&.any?
|
|
132
|
+
end
|
|
133
|
+
|
|
129
134
|
# @return [Boolean]
|
|
130
135
|
def stream?
|
|
131
136
|
!@stream.nil?
|
data/lib/omniai/version.rb
CHANGED