omniai-anthropic 3.9.0 → 3.10.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: 51669edf069f8f6e36ee785035c535721e3ee67c36c3620297f56ac81f41827c
4
- data.tar.gz: 605d8e0e44e5b3c6ffe0746240d8265577eceb525e49982b1ddf807773ce3538
3
+ metadata.gz: 8fac6cb3ea1bd260904f003583e88c839230f9898d8c33cbd8b07046924df3e8
4
+ data.tar.gz: 4214e79a1f1deeb84bb43e430a05b3cc0c70e2ae72e1ae5adcbceacc1c433a95
5
5
  SHA512:
6
- metadata.gz: e1191e0dc2452e687ee4155b411ef4f1dd898fd66ca24887a7b1539efe6b6e8e9174b938c8145228400f24df77e6515bcdb1f65573e0543917b798b1f4ae1487
7
- data.tar.gz: 249d249dcf655d636a41b44e418c339f5d6e102fc6292d15b72306de5f23b00a31b3ebcd5b88193620a7ec020496db41d4708efa18709fa61891c13d5f76737d
6
+ metadata.gz: 35faca266e9bd010842a634fc29feebce6699f432d5a08dc534a3979494bc9a00409713384644b20926358238397e9a78df058ef505da8ab0061d82d8580cd23
7
+ data.tar.gz: 750528e0bdfcc63ff0a1fb3b1e6f2c4eb8bd4036dfc2b185f30fe131cd591c63a9697028deed94e2640163f301c3e58162144f65ef5f8fe6b773b39b1d04626b
@@ -5,14 +5,20 @@ module OmniAI
5
5
  class Chat
6
6
  # Overrides tool-call response serialize / deserialize.
7
7
  module ToolCallResultSerializer
8
+ # A result whose content is media (e.g. an image) is sent as a content block rather than JSON.
9
+ #
8
10
  # @param tool_call_result [OmniAI::Chat::ToolCallResult]
11
+ # @param context [OmniAI::Context] optional
9
12
  #
10
13
  # @return [Hash]
11
- def self.serialize(tool_call_result, *)
14
+ def self.serialize(tool_call_result, context: nil)
15
+ content = tool_call_result.content
16
+ content = content.is_a?(OmniAI::Chat::Media) ? [content.serialize(context:)] : tool_call_result.text
17
+
12
18
  {
13
19
  type: "tool_result",
14
20
  tool_use_id: tool_call_result.tool_call_id,
15
- content: tool_call_result.text,
21
+ content:,
16
22
  }
17
23
  end
18
24
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Anthropic
5
- VERSION = "3.9.0"
5
+ VERSION = "3.10.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre