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 +4 -4
- data/lib/omniai/google/transcribe.rb +1 -1
- data/lib/omniai/google/transcribe_helpers.rb +6 -1
- data/lib/omniai/google/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c07c0c6fcf73437ef30346dd7123a6f78855631ce160d590dc0331b48a24097a
|
|
4
|
+
data.tar.gz: 60c2e3f6f9130116a8a34d65935588fffb04e8922c7c3df85dc01ce61734c955
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
|
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
|
|