omniai-google 3.3.2 → 3.3.3
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: c1c2cc91a787673b5e875ee28c1d5e173b129e7eacb37ece64495bb25734ceba
|
|
4
|
+
data.tar.gz: fb15b6963dd2f711248b853a3c4782d0b9762fcc05777d6f4ac90fe719ab34a6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f4ee8e419634378e0ef36954075b8ba52e682c75942a8bfeb6ad33b9f4d503d157bc294356eb33d4b174a44384956b9fd96fc09ff8824b48bad0f8cc881cdc2
|
|
7
|
+
data.tar.gz: cd252893230465bd90742145a03c202ebe7b74b887d050d65e51c62f671913d74d03e4d44e7846582cb4b108b240b02ecddd31a56838a028e3bee57ae0d28812
|
|
@@ -8,7 +8,7 @@ module OmniAI
|
|
|
8
8
|
# @param tool_call_response [OmniAI::Chat::ToolCallResult]
|
|
9
9
|
# @return [Hash]
|
|
10
10
|
def self.serialize(tool_call_response, *)
|
|
11
|
-
{
|
|
11
|
+
result = {
|
|
12
12
|
functionResponse: {
|
|
13
13
|
name: tool_call_response.tool_call_id,
|
|
14
14
|
response: {
|
|
@@ -17,6 +17,10 @@ module OmniAI
|
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
thought_signature = tool_call_response.options[:thought_signature]
|
|
22
|
+
result[:thoughtSignature] = thought_signature if thought_signature
|
|
23
|
+
result
|
|
20
24
|
end
|
|
21
25
|
|
|
22
26
|
# @param data [Hash]
|
|
@@ -9,7 +9,9 @@ module OmniAI
|
|
|
9
9
|
# @param context [OmniAI::Context]
|
|
10
10
|
# @return [Hash]
|
|
11
11
|
def self.serialize(tool_call, context:)
|
|
12
|
-
{ functionCall: tool_call.function.serialize(context:) }
|
|
12
|
+
result = { functionCall: tool_call.function.serialize(context:) }
|
|
13
|
+
result[:thoughtSignature] = tool_call.options[:thought_signature] if tool_call.options[:thought_signature]
|
|
14
|
+
result
|
|
13
15
|
end
|
|
14
16
|
|
|
15
17
|
# @param data [Hash]
|
|
@@ -17,7 +19,8 @@ module OmniAI
|
|
|
17
19
|
# @return [OmniAI::Chat::ToolCall]
|
|
18
20
|
def self.deserialize(data, context:)
|
|
19
21
|
function = OmniAI::Chat::Function.deserialize(data["functionCall"], context:)
|
|
20
|
-
|
|
22
|
+
options = { thought_signature: data["thoughtSignature"] }.compact
|
|
23
|
+
OmniAI::Chat::ToolCall.new(id: function.name, function:, **options)
|
|
21
24
|
end
|
|
22
25
|
end
|
|
23
26
|
end
|
data/lib/omniai/google/chat.rb
CHANGED
|
@@ -147,7 +147,7 @@ module OmniAI
|
|
|
147
147
|
# @return [Array<Message>]
|
|
148
148
|
def build_tool_call_messages(tool_call_list)
|
|
149
149
|
content = tool_call_list.map do |tool_call|
|
|
150
|
-
ToolCallResult.new(tool_call_id: tool_call.id, content: execute_tool_call(tool_call))
|
|
150
|
+
ToolCallResult.new(tool_call_id: tool_call.id, content: execute_tool_call(tool_call), **tool_call.options)
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
[Message.new(role: "function", content:)]
|