omniai-google 2.7.7 → 2.7.9

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: eb0ebf5227f6a88f24418703712cccfad44d0fa41251f7e84e279211e45bf8aa
4
- data.tar.gz: 465f216908801d1c440bf6bb22f1d15df8a39558d3cb2ec91bae290ff959f48d
3
+ metadata.gz: 9b718eb7991b71acbb1339523addc4b6336af98a93a978336cf79e696a838fbe
4
+ data.tar.gz: 61a97b3e556841f7880fc0f2ca3eb832940a02098e7a55dcf41eb976766ab791
5
5
  SHA512:
6
- metadata.gz: 7c2dacf677dc673f2b3c2b8ccf439f59be0cd901b23c886d40b2f8f04e11edd1574616ca2a07a59f4c4406d5bb5e06d5aca0285ba45481b22aafb552efdc5741
7
- data.tar.gz: 704d882c87af6d51800d86eaef592b1bf84e749686ad0129d7b837a7e8b800417ec1c2757c7d3728f796d0c53b640175b2eb13e369d8a179028f6f9e48fa064b
6
+ metadata.gz: 65504958cd3c74f5302c6362a72d86d9506637889a4005de4a92ac462567ea7925cfe774e12399bae64eba012cbbf1fa70fcac2e30010d869d1b3ed099b5d6dc
7
+ data.tar.gz: 680380f9201edf0a4bc4d6ebfe3a1e08c4b8c30c34b8a99d4d70dbed4beac6eb0a453bd2b2a75efc774628ff79359b7cc616e7fe91a9d1f07c3afe3a6778cae5
@@ -15,10 +15,10 @@ 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-preview-06-05"
18
+ GEMINI_2_5_PRO = "gemini-2.5-pro"
19
19
  GEMINI_1_5_FLASH = "gemini-1.5-flash"
20
20
  GEMINI_2_0_FLASH = "gemini-2.0-flash"
21
- GEMINI_2_5_FLASH = "gemini-2.5-flash-preview-04-17"
21
+ GEMINI_2_5_FLASH = "gemini-2.5-flash"
22
22
  GEMINI_PRO = GEMINI_1_5_PRO
23
23
  GEMINI_FLASH = GEMINI_2_5_FLASH
24
24
  end
@@ -55,14 +55,6 @@ module OmniAI
55
55
  def credentials=(value)
56
56
  @credentials = Credentials.parse(value)
57
57
  end
58
-
59
- # @return [Hash]
60
- def transcribe_options
61
- @transcribe_options ||= {}
62
- end
63
-
64
- # @param value [Hash]
65
- attr_writer :transcribe_options
66
58
  end
67
59
  end
68
60
  end
@@ -112,9 +112,7 @@ module OmniAI
112
112
  features = build_features
113
113
  config[:features] = features unless features.empty?
114
114
 
115
- if OmniAI::Google.config.respond_to?(:transcribe_options)
116
- config.merge!(OmniAI::Google.config.transcribe_options)
117
- end
115
+ config.merge!(OmniAI::Google.config.transcribe_options)
118
116
 
119
117
  config
120
118
  end
@@ -192,13 +190,13 @@ module OmniAI
192
190
  # Add authentication if using credentials
193
191
  connection = connection.auth("Bearer #{@client.send(:auth).split.last}") if @client.credentials?
194
192
 
195
- max_attempts = 60 # Maximum 15 minutes (15 second intervals)
193
+ max_attempts = calculate_max_polling_attempts
196
194
  attempt = 0
197
195
 
198
196
  loop do
199
197
  attempt += 1
200
198
 
201
- raise HTTPError, "Operation timed out after #{max_attempts * 15} seconds" if attempt > max_attempts
199
+ raise StandardError, "Operation timed out after #{max_attempts * 15} seconds" if attempt > max_attempts
202
200
 
203
201
  operation_response = connection.get("/v2/#{operation_name}", params: operation_params)
204
202
 
@@ -456,6 +454,17 @@ module OmniAI
456
454
  credentials = @client.instance_variable_get(:@credentials)
457
455
  ::Google::Cloud::Storage.new(project_id:, credentials:)
458
456
  end
457
+
458
+ # @return [Integer]
459
+ def calculate_max_polling_attempts
460
+ file_size_bytes = calculate_file_size
461
+ assumed_bitrate_bps = 48_000
462
+ estimated_duration_seconds = (file_size_bytes * 8.0) / assumed_bitrate_bps
463
+ estimated_processing_seconds = estimated_duration_seconds * 0.3
464
+ total_wait_seconds = estimated_processing_seconds + 90
465
+ final_wait_seconds = total_wait_seconds.clamp(180, 10_800)
466
+ (final_wait_seconds / 15).ceil
467
+ end
459
468
  end
460
469
  end
461
470
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Google
5
- VERSION = "2.7.7"
5
+ VERSION = "2.7.9"
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.7.7
4
+ version: 2.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-06-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: event_stream_parser
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubygems_version: 3.6.3
136
+ rubygems_version: 3.6.9
137
137
  specification_version: 4
138
138
  summary: A generalized framework for interacting with Google
139
139
  test_files: []