omniai-google 1.8.1 → 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c10ff758ef3b97bfda6e7777bbdb07f70f4d48eec2ed83a16d40ff218c1ad0c
4
- data.tar.gz: 530abe5f05bb1a00531ce5e9688622d4b2ffcdba648f91828051d401e251c696
3
+ metadata.gz: '05953e1154c7f24ee6d502ea7cb45661c64c0633ccf42ca507a3574374912a71'
4
+ data.tar.gz: 6e01a56c6c1f41bf2129a9aefe053aae33bb3ea6d63beb6b05fb5922ee7b9baf
5
5
  SHA512:
6
- metadata.gz: 84fa7dcd0046e15f573dd93ed96e85a69e432e01ec7114eda1b02e7c38769e2a508fa82d1ec7b869c5517f7caee5f79a10e290597b71b819eb24b63c73e801b1
7
- data.tar.gz: 11367206b9ad7392ef6184691168a9a57bbad972aca66427a8ae69a25386c5283b42d76490000a90fadd9b5de8370d213fde3f9bc88185018dba500b6fef598f
6
+ metadata.gz: 3c1cf6d1e36143ad8cfa154b03cace02a4f02e7514778512b3310133a9716ca3291dd7c20b924c475a3006786bfb1bf4830f7d455787c10b18a99ffc66def9e8
7
+ data.tar.gz: 196f1458b212e5809fdb10c6b2a5a1c7ca7dfa443ef9eed384ef148afad43d56591486e1cb838f35455cd00ecbc0f847a0f0b8ce328848bbb0d5fc8720700d0b
@@ -14,7 +14,7 @@ module OmniAI
14
14
 
15
15
  {
16
16
  candidates:,
17
- usage_metadata:,
17
+ usageMetadata: usage_metadata,
18
18
  }
19
19
  end
20
20
 
@@ -23,7 +23,7 @@ module OmniAI
23
23
  # @return [OmniAI::Chat::Payload]
24
24
  def self.deserialize(data, context:)
25
25
  choices = data['candidates'].map { |candidate| OmniAI::Chat::Choice.deserialize(candidate, context:) }
26
- usage = OmniAI::Chat::Usage.deserialize(data['usage_metadata'], context:) if data['usage_metadata']
26
+ usage = OmniAI::Chat::Usage.deserialize(data['usageMetadata'], context:) if data['usageMetadata']
27
27
 
28
28
  OmniAI::Chat::Payload.new(choices:, usage:)
29
29
  end
@@ -9,18 +9,18 @@ module OmniAI
9
9
  # @return [Hash]
10
10
  def self.serialize(usage, *)
11
11
  {
12
- prompt_token_count: usage.input_tokens,
13
- candidates_token_count: usage.output_tokens,
14
- total_token_count: usage.total_tokens,
12
+ promptTokenCount: usage.input_tokens,
13
+ candidatesTokenCount: usage.output_tokens,
14
+ totalTokenCount: usage.total_tokens,
15
15
  }
16
16
  end
17
17
 
18
18
  # @param data [Hash]
19
19
  # @return [OmniAI::Chat::Usage]
20
20
  def self.deserialize(data, *)
21
- input_tokens = data['prompt_token_count']
22
- output_tokens = data['candidates_token_count']
23
- total_tokens = data['total_token_count']
21
+ input_tokens = data['promptTokenCount']
22
+ output_tokens = data['candidatesTokenCount']
23
+ total_tokens = data['totalTokenCount']
24
24
  OmniAI::Chat::Usage.new(input_tokens:, output_tokens:, total_tokens:)
25
25
  end
26
26
  end
@@ -89,7 +89,7 @@ module OmniAI
89
89
 
90
90
  # @return [Hash]
91
91
  def tools
92
- return unless @tools
92
+ return unless @tools&.any?
93
93
 
94
94
  [
95
95
  function_declarations: @tools.map { |tool| tool.serialize(context:) },
@@ -10,7 +10,7 @@ module OmniAI
10
10
  end
11
11
 
12
12
  DEFAULT_HOST = 'https://generativelanguage.googleapis.com'
13
- DEFAULT_VERSION = Version::STABLE
13
+ DEFAULT_VERSION = Version::BETA
14
14
 
15
15
  # @!attribute [rw] version
16
16
  # @return [String, nil]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Google
5
- VERSION = '1.8.1'
5
+ VERSION = '1.8.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-19 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_stream_parser