omniai-google 2.6.3 → 2.6.5

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: 1f578af1eb17aad95c7d8d95241481ea6fa606f9dbdca2bfb098e664874cbfe1
4
- data.tar.gz: 8ffb8c563e0e1464aeaecd38d7b764227b3a13302a130c43d5a1989f9abb6cfc
3
+ metadata.gz: a1f3c06628af28183c2e2224b794ed0f105b136208dc06231ad9fc43e77254e5
4
+ data.tar.gz: f267290388bc2a067f202d0da53581c0142363b69d99d47c6a4e1d5ef722f720
5
5
  SHA512:
6
- metadata.gz: 8db2a30f2424c265690d6d9d7910c1de1774ddc452405c64a37a323fcaa1a9f0571128ceb03d47dda98ba5c943708b26a127f881c954d533977d2ca81c377401
7
- data.tar.gz: 3a6245e97f79785079a3490eed18cdc32f5da909863959fbef281f40df7a5da2dff4416725dd56b173c73a7dd0c06b945a52143d37a229c539e4a4eed9ea5d3d
6
+ metadata.gz: 4f013c574fc90c3fe31dccdc4ac424020908866fb8efd0b027c3d92b6e901b2a7656bfba527a37af80af17be9b33e42f1b6caa3b9a784f80e678558e1bbeee53
7
+ data.tar.gz: '08dea5482ac8679c3d382ecf1830f634e85e652a94f470654ebcb5468898ec30473b7be6047535a056475542d30e1ef0f29dbba851fc1f252050ececfeb3af1a'
@@ -44,8 +44,8 @@ module OmniAI
44
44
  @data[key] = value unless key.eql?("candidates")
45
45
  end
46
46
 
47
- data["candidates"].each do |candidate|
48
- process_candidate!(candidate:, &block)
47
+ data["candidates"].each_with_index do |candidate, index|
48
+ process_candidate!(candidate:, index:, &block)
49
49
  end
50
50
  end
51
51
 
@@ -53,19 +53,19 @@ module OmniAI
53
53
  # @yieldparam delta [OmniAI::Chat::Delta]
54
54
  #
55
55
  # @param candidate [Hash]
56
- def process_candidate!(candidate:, &block)
56
+ def process_candidate!(candidate:, index:, &block)
57
+ return unless candidate["content"]
58
+
57
59
  candidate["content"]["parts"].each do |part|
58
60
  block&.call(OmniAI::Chat::Delta.new(text: part["text"])) if part["text"]
59
61
  end
60
62
 
61
- merge_candidate!(candidate:)
63
+ merge_candidate!(candidate:, index:)
62
64
  end
63
65
 
64
66
  # @param candidate [Hash]
65
- def merge_candidate!(candidate:)
66
- index = candidate["index"]
67
- raise candidate.inspect if index.nil?
68
-
67
+ # @param index [Integer]
68
+ def merge_candidate!(candidate:, index:)
69
69
  if @data["candidates"][index].nil?
70
70
  @data["candidates"][index] = candidate
71
71
  else
@@ -15,7 +15,7 @@ module OmniAI
15
15
  module Model
16
16
  GEMINI_1_0_PRO = "gemini-1.0-pro"
17
17
  GEMINI_1_5_PRO = "gemini-1.5-pro"
18
- GEMINI_2_5_PRO = "gemini-2.5-pro-exp-03-25"
18
+ GEMINI_2_5_PRO = "gemini-2.5-pro-preview-05-06"
19
19
  GEMINI_1_5_FLASH = "gemini-1.5-flash"
20
20
  GEMINI_2_0_FLASH = "gemini-2.0-flash"
21
21
  GEMINI_2_5_FLASH = "gemini-2.5-flash-preview-04-17"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Google
5
- VERSION = "2.6.3"
5
+ VERSION = "2.6.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.3
4
+ version: 2.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-05-13 00:00:00.000000000 Z
10
+ date: 2025-05-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: event_stream_parser