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 +4 -4
- data/lib/omniai/google/chat.rb +2 -2
- data/lib/omniai/google/config.rb +0 -8
- data/lib/omniai/google/transcribe_helpers.rb +14 -5
- data/lib/omniai/google/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b718eb7991b71acbb1339523addc4b6336af98a93a978336cf79e696a838fbe
|
4
|
+
data.tar.gz: 61a97b3e556841f7880fc0f2ca3eb832940a02098e7a55dcf41eb976766ab791
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65504958cd3c74f5302c6362a72d86d9506637889a4005de4a92ac462567ea7925cfe774e12399bae64eba012cbbf1fa70fcac2e30010d869d1b3ed099b5d6dc
|
7
|
+
data.tar.gz: 680380f9201edf0a4bc4d6ebfe3a1e08c4b8c30c34b8a99d4d70dbed4beac6eb0a453bd2b2a75efc774628ff79359b7cc616e7fe91a9d1f07c3afe3a6778cae5
|
data/lib/omniai/google/chat.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/omniai/google/config.rb
CHANGED
@@ -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
|
-
|
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 =
|
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
|
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
|
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.
|
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:
|
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.
|
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: []
|