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: 3795f5d5c698378221680d69e8deca6600dff009320b3856b9865240f97307b2
4
- data.tar.gz: 7b1520bbd36617f08b90358c5453418f3165162ed43e4571545314e9b4b3b9b1
3
+ metadata.gz: c1c2cc91a787673b5e875ee28c1d5e173b129e7eacb37ece64495bb25734ceba
4
+ data.tar.gz: fb15b6963dd2f711248b853a3c4782d0b9762fcc05777d6f4ac90fe719ab34a6
5
5
  SHA512:
6
- metadata.gz: 0d48d1c914cf54480fe30a253abdaf611e13f2b3f49c342eaee8574e061a5a4870dc080b70b5cdb9af2b789e75b8c68d92e12c9d6332c7a6644ebd8381d47337
7
- data.tar.gz: 92fb6fd5dc9c1d2720b22c4264f9ae0487c1e0f9ab63c67c9574e547cf71be3c47eb2d96a4a7feb7717c49cc48a4057276e6959189f57d3fc494a03a87497535
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
- OmniAI::Chat::ToolCall.new(id: function.name, function:)
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
@@ -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:)]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Google
5
- VERSION = "3.3.2"
5
+ VERSION = "3.3.3"
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.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre