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: 9fd43c08069868c8d20d91ac6e1028baf97643eda9018a0db146c73ce0828c15
4
- data.tar.gz: 04ca6d4c4789b91c194abb44f8d2d178f1e65605644fe3c72a72824e8707a9e2
3
+ metadata.gz: 10f903f10526a5e5b609434b87ab652142e7298e5fa881fbd9bba342baeae696
4
+ data.tar.gz: 0b9a117af8acd962fc427a88472f7d5f749e9cfa4848371e723eee191b034ded
5
5
  SHA512:
6
- metadata.gz: 3b2076e4c7f504e899015fbd0c8fb4f3290d347d2191051cdad1a6e079f45b6086bf8b6725693d073c45e02adf85bc43be7aace65a37fce282a163ed338596c6
7
- data.tar.gz: ebf586d81abd71f7959f12f85159a27b3a5a53cd4966adcc2e05bec009341378fc306140ca0f94e129a3a4df1875ba2b5433e1b2b738e2c78c6a2eaf24ab0e87
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
- name: tool_call_response.tool_call_id,
14
- response: {
15
- name: tool_call_response.tool_call_id,
16
- content: tool_call_response.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]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Google
5
- VERSION = "3.17.0"
5
+ VERSION = "3.18.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.17.0
4
+ version: 3.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre