omniai-google 3.17.0 → 3.18.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 10f903f10526a5e5b609434b87ab652142e7298e5fa881fbd9bba342baeae696
|
|
4
|
+
data.tar.gz: 0b9a117af8acd962fc427a88472f7d5f749e9cfa4848371e723eee191b034ded
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5ba5463d9357d4cf12910d26beb99f4300b123c2efa44b9d0b52e1410acfc698cbf8e601e6a2f730664e946b9178522d736c72cabc661524c2adc01b494f4fc
|
|
7
|
+
data.tar.gz: 99d73d1e2a2ba26424e3cb0ad302fea0ad51e944864ac8d3e14d8770220618386f20c59b1b1ec62a7d50bae3ad15343b1140e2b80b14faebeeb235dbc3460aa1
|
|
@@ -5,17 +5,21 @@ module OmniAI
|
|
|
5
5
|
class Chat
|
|
6
6
|
# Overrides tool-call result serialize / deserialize.
|
|
7
7
|
module ToolCallResultSerializer
|
|
8
|
+
# A result whose content is media (e.g. an image) is sent as a multimodal function response part.
|
|
9
|
+
#
|
|
8
10
|
# @param tool_call_response [OmniAI::Chat::ToolCallResult]
|
|
9
11
|
# @return [Hash]
|
|
10
12
|
def self.serialize(tool_call_response, *)
|
|
13
|
+
name = tool_call_response.tool_call_id
|
|
14
|
+
content = tool_call_response.content
|
|
15
|
+
|
|
11
16
|
result = {
|
|
12
|
-
functionResponse:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
content:
|
|
17
|
-
|
|
18
|
-
},
|
|
17
|
+
functionResponse:
|
|
18
|
+
if content.is_a?(OmniAI::Chat::Media)
|
|
19
|
+
{ name:, response: { name: }, parts: [MediaSerializer.serialize(content)] }
|
|
20
|
+
else
|
|
21
|
+
{ name:, response: { name:, content: } }
|
|
22
|
+
end,
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
thought_signature = tool_call_response.options[:thought_signature]
|