omniai-google 3.18.1 → 3.18.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: cc3b952ff375db770509f12502a396e2a7cbdd9675467f76f3e83c6eb8e0ce23
4
- data.tar.gz: 9f7c3394ad70dd14035ed1fe3dd60b9b2097d4708c8f744601e66bfee5fc09d9
3
+ metadata.gz: c07c0c6fcf73437ef30346dd7123a6f78855631ce160d590dc0331b48a24097a
4
+ data.tar.gz: 60c2e3f6f9130116a8a34d65935588fffb04e8922c7c3df85dc01ce61734c955
5
5
  SHA512:
6
- metadata.gz: daf96548f0e096cd0fa5c7b2cfb2c1dda1e70559dab2f98ba75a69dd00ff00e443969529c634f317b8df84d089b25106640d6478bfd54473034fd082f23a0a25
7
- data.tar.gz: 56aa7271fc97ac4002c739eedbddb8834bf440f2d4868732b31f68a250425d2a6f1f6b9fe22a1496f08deb115fd66312813c08fa5396042d9b76ea9a360fafe6
6
+ metadata.gz: 180ec343c726b29490fd2a0720b1ce2b1d321bf263badfc113908d7b7d5f1aa3857f395fdc9c415fc59cd4ce925fc5583ef2e0842388316da47137f19a1790b5
7
+ data.tar.gz: b3a3d233bbcbe4a753bca419edc63482e2aba1143d3323e8be7dffdd6a23678e423e7db0e4f69af8a8b585cd9683537425424065c995fd088a93efb8feab895e
@@ -77,7 +77,7 @@ module OmniAI
77
77
  operation_data = response.parse
78
78
  operation_name = operation_data["name"]
79
79
 
80
- raise HTTPError, "No operation name returned from batch recognition request" unless operation_name
80
+ raise OmniAI::Error, "No operation name returned from batch recognition request" unless operation_name
81
81
 
82
82
  # Poll for completion
83
83
  result = poll_operation!(operation_name)
@@ -237,7 +237,7 @@ module OmniAI
237
237
  # Check for errors
238
238
  if operation_data["error"]
239
239
  error_message = operation_data.dig("error", "message") || "Unknown error"
240
- raise HTTPError, "Operation failed: #{error_message}"
240
+ raise OmniAI::Error, "Operation failed: #{error_message}"
241
241
  end
242
242
 
243
243
  # Check if done
@@ -288,6 +288,11 @@ module OmniAI
288
288
  file_result = batch_results.values.first
289
289
  return empty_transcript_data unless file_result
290
290
 
291
+ # A done operation can still carry a per-file failure (e.g. unsupported encoding)
292
+ if (error = file_result["error"])
293
+ raise OmniAI::Error, "Transcription failed (code #{error['code']}): #{error['message']}"
294
+ end
295
+
291
296
  transcript_segments = file_result.dig("transcript", "results")
292
297
  return empty_transcript_data unless transcript_segments&.any?
293
298
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Google
5
- VERSION = "3.18.1"
5
+ VERSION = "3.18.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.18.1
4
+ version: 3.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre