omniai-google 2.6.1 → 2.6.2

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: c901bbfae98e15ee5741f97f8a28189814495b3f2b15a40cba9ffe9e4d5e62d4
4
- data.tar.gz: 3c5d7e4544a778bc05dda49e2b8d3e6e7675307d0f0985ff55676e9fbcc6ca98
3
+ metadata.gz: cb64970aa23a098c48810b8d2d299665c383d188d7a908c1d331375235083dc5
4
+ data.tar.gz: 10161c3268426a21701d82ecf7a87f24b4afc901f17e283eeeb999ad717d96c0
5
5
  SHA512:
6
- metadata.gz: bf21ab638a26791419a04139405064bb974120b0be0a45e77981da82d204bb494c1436a270538a31540a7cc7d4c1b351aa594d773de0851ab4d79797cd767209
7
- data.tar.gz: c267e9b001991241574a7fe5895c4e3e56336191d647627c0be202db5b84d3ae568659640edde6728ac58d71067cb5d36f1aa280dfda6ebcab36c788fd321975
6
+ metadata.gz: a261a66b7a8ddfb723a2327dda567a8494bba59420626a6f57dbd4f76838b9f603ef5c619b08af245ecb2a72865d7a9bf905c320d6bd1d4df943bf60141fc649
7
+ data.tar.gz: 9ff5956e21aeefa6fe4829dfe5f629a94ddb35b49e24fad1e5e5f48b065c58c393265aeb7b1bbfa2a4b9136dcfb74798f904bc960c05f14870b69987a1d4160d
@@ -45,12 +45,24 @@ module OmniAI
45
45
  end
46
46
 
47
47
  data["candidates"].each_with_index do |candidate, index|
48
- candidate["content"]["parts"].each do |part|
49
- block&.call(OmniAI::Chat::Delta.new(text: part["text"])) if part["text"]
50
- end
48
+ process_candidate!(candidate:, index:, &block)
49
+ end
50
+ end
51
+
52
+ # @yield [delta]
53
+ # @yieldparam delta [OmniAI::Chat::Delta]
54
+ #
55
+ # @param candidate [Hash]
56
+ # @param index [Integer]
57
+ def process_candidate!(candidate:, index:, &block)
58
+ parts = candidate["content"]["parts"]
59
+ return unless parts
51
60
 
52
- merge_candidate!(candidate:, index:, &block)
61
+ candidate["content"]["parts"].each do |part|
62
+ block&.call(OmniAI::Chat::Delta.new(text: part["text"])) if part["text"]
53
63
  end
64
+
65
+ merge_candidate!(candidate:, index:)
54
66
  end
55
67
 
56
68
  # @param candidate [Hash]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Google
5
- VERSION = "2.6.1"
5
+ VERSION = "2.6.2"
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.1
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-05-08 00:00:00.000000000 Z
10
+ date: 2025-05-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: event_stream_parser