azure_stt 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -3
- data/.gitignore +2 -2
- data/CHANGELOG.md +16 -1
- data/Gemfile +3 -2
- data/README.md +2 -2
- data/azure_stt.gemspec +5 -2
- data/docs/AzureSTT/Client.html +148 -39
- data/docs/AzureSTT/Configuration.html +4 -4
- data/docs/AzureSTT/Error.html +4 -170
- data/docs/AzureSTT/Models/Base.html +4 -4
- data/docs/AzureSTT/Models/CombinedRecognizedPhrases.html +4 -4
- data/docs/AzureSTT/Models/File.html +5 -5
- data/docs/AzureSTT/Models/RecognizedPhrase.html +4 -4
- data/docs/AzureSTT/Models/Report.html +4 -4
- data/docs/AzureSTT/Models/Result.html +4 -4
- data/docs/AzureSTT/Models/Sentence.html +4 -4
- data/docs/AzureSTT/Models/Transcription.html +5 -5
- data/docs/AzureSTT/Models/Word.html +4 -4
- data/docs/AzureSTT/Models.html +4 -4
- data/docs/AzureSTT/NetError.html +161 -11
- data/docs/AzureSTT/Parsers/Base.html +4 -4
- data/docs/AzureSTT/Parsers/CombinedRecognizedPhrases.html +4 -4
- data/docs/AzureSTT/Parsers/File.html +4 -4
- data/docs/AzureSTT/Parsers/RecognizedPhrase.html +4 -4
- data/docs/AzureSTT/Parsers/Report.html +4 -4
- data/docs/AzureSTT/Parsers/Result.html +4 -4
- data/docs/AzureSTT/Parsers/Sentence.html +4 -4
- data/docs/AzureSTT/Parsers/Transcription.html +4 -4
- data/docs/AzureSTT/Parsers/Word.html +4 -4
- data/docs/AzureSTT/Parsers.html +4 -4
- data/docs/AzureSTT/ServiceError.html +161 -11
- data/docs/AzureSTT/Session.html +132 -24
- data/docs/AzureSTT/Types.html +4 -4
- data/docs/AzureSTT.html +4 -4
- data/docs/AzureStt_.html +5 -5
- data/docs/_index.html +5 -5
- data/docs/file.README.html +133 -95
- data/docs/frames.html +1 -1
- data/docs/index.html +133 -95
- data/docs/method_list.html +66 -34
- data/docs/top-level-namespace.html +4 -4
- data/lib/azure_stt/client.rb +9 -8
- data/lib/azure_stt/errors.rb +16 -9
- data/lib/azure_stt/models/file.rb +1 -1
- data/lib/azure_stt/models/transcription.rb +1 -1
- data/lib/azure_stt/parsers/combined_recognized_phrases.rb +1 -1
- data/lib/azure_stt/session.rb +8 -10
- data/lib/azure_stt/version.rb +1 -1
- data/lib/azure_stt.rb +2 -2
- metadata +7 -11
- data/.github/dependabot.yml +0 -6
- data/Gemfile.lock +0 -141
- data/docs/AzureBatchTranscription/Configuration.html +0 -212
- data/docs/AzureBatchTranscription.html +0 -301
- data/docs/AzureSTT/Transcription.html +0 -635
data/docs/method_list.html
CHANGED
@@ -94,13 +94,21 @@
|
|
94
94
|
|
95
95
|
<li class="odd ">
|
96
96
|
<div class="item">
|
97
|
-
<span class='object_link'><a href="AzureSTT/
|
98
|
-
<small>AzureSTT::
|
97
|
+
<span class='object_link'><a href="AzureSTT/ServiceError.html#code-instance_method" title="AzureSTT::ServiceError#code (method)">#code</a></span>
|
98
|
+
<small>AzureSTT::ServiceError</small>
|
99
99
|
</div>
|
100
100
|
</li>
|
101
101
|
|
102
102
|
|
103
103
|
<li class="even ">
|
104
|
+
<div class="item">
|
105
|
+
<span class='object_link'><a href="AzureSTT/NetError.html#code-instance_method" title="AzureSTT::NetError#code (method)">#code</a></span>
|
106
|
+
<small>AzureSTT::NetError</small>
|
107
|
+
</div>
|
108
|
+
</li>
|
109
|
+
|
110
|
+
|
111
|
+
<li class="odd ">
|
104
112
|
<div class="item">
|
105
113
|
<span class='object_link'><a href="AzureSTT/Models/Result.html#combined_recognized_phrases-instance_method" title="AzureSTT::Models::Result#combined_recognized_phrases (method)">#combined_recognized_phrases</a></span>
|
106
114
|
<small>AzureSTT::Models::Result</small>
|
@@ -108,7 +116,7 @@
|
|
108
116
|
</li>
|
109
117
|
|
110
118
|
|
111
|
-
<li class="
|
119
|
+
<li class="even ">
|
112
120
|
<div class="item">
|
113
121
|
<span class='object_link'><a href="AzureSTT/Models/Word.html#confidence-instance_method" title="AzureSTT::Models::Word#confidence (method)">#confidence</a></span>
|
114
122
|
<small>AzureSTT::Models::Word</small>
|
@@ -116,7 +124,7 @@
|
|
116
124
|
</li>
|
117
125
|
|
118
126
|
|
119
|
-
<li class="
|
127
|
+
<li class="odd ">
|
120
128
|
<div class="item">
|
121
129
|
<span class='object_link'><a href="AzureSTT/Models/Sentence.html#confidence-instance_method" title="AzureSTT::Models::Sentence#confidence (method)">#confidence</a></span>
|
122
130
|
<small>AzureSTT::Models::Sentence</small>
|
@@ -124,7 +132,7 @@
|
|
124
132
|
</li>
|
125
133
|
|
126
134
|
|
127
|
-
<li class="
|
135
|
+
<li class="even ">
|
128
136
|
<div class="item">
|
129
137
|
<span class='object_link'><a href="AzureSTT.html#configuration-class_method" title="AzureSTT.configuration (method)">configuration</a></span>
|
130
138
|
<small>AzureSTT</small>
|
@@ -132,7 +140,7 @@
|
|
132
140
|
</li>
|
133
141
|
|
134
142
|
|
135
|
-
<li class="
|
143
|
+
<li class="odd ">
|
136
144
|
<div class="item">
|
137
145
|
<span class='object_link'><a href="AzureSTT.html#configure-class_method" title="AzureSTT.configure (method)">configure</a></span>
|
138
146
|
<small>AzureSTT</small>
|
@@ -140,7 +148,7 @@
|
|
140
148
|
</li>
|
141
149
|
|
142
150
|
|
143
|
-
<li class="
|
151
|
+
<li class="even ">
|
144
152
|
<div class="item">
|
145
153
|
<span class='object_link'><a href="AzureSTT/Models/File.html#content-instance_method" title="AzureSTT::Models::File#content (method)">#content</a></span>
|
146
154
|
<small>AzureSTT::Models::File</small>
|
@@ -148,7 +156,7 @@
|
|
148
156
|
</li>
|
149
157
|
|
150
158
|
|
151
|
-
<li class="
|
159
|
+
<li class="odd ">
|
152
160
|
<div class="item">
|
153
161
|
<span class='object_link'><a href="AzureSTT/Models/File.html#content_url-instance_method" title="AzureSTT::Models::File#content_url (method)">#content_url</a></span>
|
154
162
|
<small>AzureSTT::Models::File</small>
|
@@ -156,7 +164,7 @@
|
|
156
164
|
</li>
|
157
165
|
|
158
166
|
|
159
|
-
<li class="
|
167
|
+
<li class="even ">
|
160
168
|
<div class="item">
|
161
169
|
<span class='object_link'><a href="AzureSTT/Client.html#create_transcription-instance_method" title="AzureSTT::Client#create_transcription (method)">#create_transcription</a></span>
|
162
170
|
<small>AzureSTT::Client</small>
|
@@ -164,7 +172,7 @@
|
|
164
172
|
</li>
|
165
173
|
|
166
174
|
|
167
|
-
<li class="
|
175
|
+
<li class="odd ">
|
168
176
|
<div class="item">
|
169
177
|
<span class='object_link'><a href="AzureSTT/Session.html#create_transcription-instance_method" title="AzureSTT::Session#create_transcription (method)">#create_transcription</a></span>
|
170
178
|
<small>AzureSTT::Session</small>
|
@@ -172,7 +180,7 @@
|
|
172
180
|
</li>
|
173
181
|
|
174
182
|
|
175
|
-
<li class="
|
183
|
+
<li class="even ">
|
176
184
|
<div class="item">
|
177
185
|
<span class='object_link'><a href="AzureSTT/Models/File.html#created_date_time-instance_method" title="AzureSTT::Models::File#created_date_time (method)">#created_date_time</a></span>
|
178
186
|
<small>AzureSTT::Models::File</small>
|
@@ -180,7 +188,7 @@
|
|
180
188
|
</li>
|
181
189
|
|
182
190
|
|
183
|
-
<li class="
|
191
|
+
<li class="odd ">
|
184
192
|
<div class="item">
|
185
193
|
<span class='object_link'><a href="AzureSTT/Models/Transcription.html#created_date_time-instance_method" title="AzureSTT::Models::Transcription#created_date_time (method)">#created_date_time</a></span>
|
186
194
|
<small>AzureSTT::Models::Transcription</small>
|
@@ -188,7 +196,23 @@
|
|
188
196
|
</li>
|
189
197
|
|
190
198
|
|
199
|
+
<li class="even ">
|
200
|
+
<div class="item">
|
201
|
+
<span class='object_link'><a href="AzureSTT/Client.html#delete_transcription-instance_method" title="AzureSTT::Client#delete_transcription (method)">#delete_transcription</a></span>
|
202
|
+
<small>AzureSTT::Client</small>
|
203
|
+
</div>
|
204
|
+
</li>
|
205
|
+
|
206
|
+
|
191
207
|
<li class="odd ">
|
208
|
+
<div class="item">
|
209
|
+
<span class='object_link'><a href="AzureSTT/Session.html#delete_transcription-instance_method" title="AzureSTT::Session#delete_transcription (method)">#delete_transcription</a></span>
|
210
|
+
<small>AzureSTT::Session</small>
|
211
|
+
</div>
|
212
|
+
</li>
|
213
|
+
|
214
|
+
|
215
|
+
<li class="even ">
|
192
216
|
<div class="item">
|
193
217
|
<span class='object_link'><a href="AzureSTT/Models/Report.html#details-instance_method" title="AzureSTT::Models::Report#details (method)">#details</a></span>
|
194
218
|
<small>AzureSTT::Models::Report</small>
|
@@ -196,7 +220,7 @@
|
|
196
220
|
</li>
|
197
221
|
|
198
222
|
|
199
|
-
<li class="
|
223
|
+
<li class="odd ">
|
200
224
|
<div class="item">
|
201
225
|
<span class='object_link'><a href="AzureSTT/Models/Transcription.html#display_name-instance_method" title="AzureSTT::Models::Transcription#display_name (method)">#display_name</a></span>
|
202
226
|
<small>AzureSTT::Models::Transcription</small>
|
@@ -204,7 +228,7 @@
|
|
204
228
|
</li>
|
205
229
|
|
206
230
|
|
207
|
-
<li class="
|
231
|
+
<li class="even ">
|
208
232
|
<div class="item">
|
209
233
|
<span class='object_link'><a href="AzureSTT/Models/Word.html#duration-instance_method" title="AzureSTT::Models::Word#duration (method)">#duration</a></span>
|
210
234
|
<small>AzureSTT::Models::Word</small>
|
@@ -212,7 +236,7 @@
|
|
212
236
|
</li>
|
213
237
|
|
214
238
|
|
215
|
-
<li class="
|
239
|
+
<li class="odd ">
|
216
240
|
<div class="item">
|
217
241
|
<span class='object_link'><a href="AzureSTT/Models/Result.html#duration-instance_method" title="AzureSTT::Models::Result#duration (method)">#duration</a></span>
|
218
242
|
<small>AzureSTT::Models::Result</small>
|
@@ -220,7 +244,7 @@
|
|
220
244
|
</li>
|
221
245
|
|
222
246
|
|
223
|
-
<li class="
|
247
|
+
<li class="even ">
|
224
248
|
<div class="item">
|
225
249
|
<span class='object_link'><a href="AzureSTT/Models/RecognizedPhrase.html#duration-instance_method" title="AzureSTT::Models::RecognizedPhrase#duration (method)">#duration</a></span>
|
226
250
|
<small>AzureSTT::Models::RecognizedPhrase</small>
|
@@ -228,7 +252,7 @@
|
|
228
252
|
</li>
|
229
253
|
|
230
254
|
|
231
|
-
<li class="
|
255
|
+
<li class="odd ">
|
232
256
|
<div class="item">
|
233
257
|
<span class='object_link'><a href="AzureSTT/Models/Word.html#duration_in_ticks-instance_method" title="AzureSTT::Models::Word#duration_in_ticks (method)">#duration_in_ticks</a></span>
|
234
258
|
<small>AzureSTT::Models::Word</small>
|
@@ -236,7 +260,7 @@
|
|
236
260
|
</li>
|
237
261
|
|
238
262
|
|
239
|
-
<li class="
|
263
|
+
<li class="even ">
|
240
264
|
<div class="item">
|
241
265
|
<span class='object_link'><a href="AzureSTT/Models/Result.html#duration_in_ticks-instance_method" title="AzureSTT::Models::Result#duration_in_ticks (method)">#duration_in_ticks</a></span>
|
242
266
|
<small>AzureSTT::Models::Result</small>
|
@@ -244,7 +268,7 @@
|
|
244
268
|
</li>
|
245
269
|
|
246
270
|
|
247
|
-
<li class="
|
271
|
+
<li class="odd ">
|
248
272
|
<div class="item">
|
249
273
|
<span class='object_link'><a href="AzureSTT/Models/RecognizedPhrase.html#duration_in_ticks-instance_method" title="AzureSTT::Models::RecognizedPhrase#duration_in_ticks (method)">#duration_in_ticks</a></span>
|
250
274
|
<small>AzureSTT::Models::RecognizedPhrase</small>
|
@@ -252,7 +276,7 @@
|
|
252
276
|
</li>
|
253
277
|
|
254
278
|
|
255
|
-
<li class="
|
279
|
+
<li class="even ">
|
256
280
|
<div class="item">
|
257
281
|
<span class='object_link'><a href="AzureSTT/Models/Transcription.html#failed%3F-instance_method" title="AzureSTT::Models::Transcription#failed? (method)">#failed?</a></span>
|
258
282
|
<small>AzureSTT::Models::Transcription</small>
|
@@ -260,7 +284,7 @@
|
|
260
284
|
</li>
|
261
285
|
|
262
286
|
|
263
|
-
<li class="
|
287
|
+
<li class="odd ">
|
264
288
|
<div class="item">
|
265
289
|
<span class='object_link'><a href="AzureSTT/Models/Report.html#failed_transcriptions_count-instance_method" title="AzureSTT::Models::Report#failed_transcriptions_count (method)">#failed_transcriptions_count</a></span>
|
266
290
|
<small>AzureSTT::Models::Report</small>
|
@@ -268,7 +292,7 @@
|
|
268
292
|
</li>
|
269
293
|
|
270
294
|
|
271
|
-
<li class="
|
295
|
+
<li class="even ">
|
272
296
|
<div class="item">
|
273
297
|
<span class='object_link'><a href="AzureSTT/Models/Transcription.html#finished%3F-instance_method" title="AzureSTT::Models::Transcription#finished? (method)">#finished?</a></span>
|
274
298
|
<small>AzureSTT::Models::Transcription</small>
|
@@ -276,7 +300,7 @@
|
|
276
300
|
</li>
|
277
301
|
|
278
302
|
|
279
|
-
<li class="
|
303
|
+
<li class="odd ">
|
280
304
|
<div class="item">
|
281
305
|
<span class='object_link'><a href="AzureSTT/Client.html#get_file-instance_method" title="AzureSTT::Client#get_file (method)">#get_file</a></span>
|
282
306
|
<small>AzureSTT::Client</small>
|
@@ -284,7 +308,7 @@
|
|
284
308
|
</li>
|
285
309
|
|
286
310
|
|
287
|
-
<li class="
|
311
|
+
<li class="even ">
|
288
312
|
<div class="item">
|
289
313
|
<span class='object_link'><a href="AzureSTT/Client.html#get_transcription-instance_method" title="AzureSTT::Client#get_transcription (method)">#get_transcription</a></span>
|
290
314
|
<small>AzureSTT::Client</small>
|
@@ -292,7 +316,7 @@
|
|
292
316
|
</li>
|
293
317
|
|
294
318
|
|
295
|
-
<li class="
|
319
|
+
<li class="odd ">
|
296
320
|
<div class="item">
|
297
321
|
<span class='object_link'><a href="AzureSTT/Session.html#get_transcription-instance_method" title="AzureSTT::Session#get_transcription (method)">#get_transcription</a></span>
|
298
322
|
<small>AzureSTT::Session</small>
|
@@ -300,7 +324,7 @@
|
|
300
324
|
</li>
|
301
325
|
|
302
326
|
|
303
|
-
<li class="
|
327
|
+
<li class="even ">
|
304
328
|
<div class="item">
|
305
329
|
<span class='object_link'><a href="AzureSTT/Client.html#get_transcription_files-instance_method" title="AzureSTT::Client#get_transcription_files (method)">#get_transcription_files</a></span>
|
306
330
|
<small>AzureSTT::Client</small>
|
@@ -308,7 +332,7 @@
|
|
308
332
|
</li>
|
309
333
|
|
310
334
|
|
311
|
-
<li class="
|
335
|
+
<li class="odd ">
|
312
336
|
<div class="item">
|
313
337
|
<span class='object_link'><a href="AzureSTT/Client.html#get_transcriptions-instance_method" title="AzureSTT::Client#get_transcriptions (method)">#get_transcriptions</a></span>
|
314
338
|
<small>AzureSTT::Client</small>
|
@@ -316,7 +340,7 @@
|
|
316
340
|
</li>
|
317
341
|
|
318
342
|
|
319
|
-
<li class="
|
343
|
+
<li class="even ">
|
320
344
|
<div class="item">
|
321
345
|
<span class='object_link'><a href="AzureSTT/Session.html#get_transcriptions-instance_method" title="AzureSTT::Session#get_transcriptions (method)">#get_transcriptions</a></span>
|
322
346
|
<small>AzureSTT::Session</small>
|
@@ -324,7 +348,7 @@
|
|
324
348
|
</li>
|
325
349
|
|
326
350
|
|
327
|
-
<li class="
|
351
|
+
<li class="odd ">
|
328
352
|
<div class="item">
|
329
353
|
<span class='object_link'><a href="AzureSTT/Parsers/Base.html#hash-instance_method" title="AzureSTT::Parsers::Base#hash (method)">#hash</a></span>
|
330
354
|
<small>AzureSTT::Parsers::Base</small>
|
@@ -332,7 +356,7 @@
|
|
332
356
|
</li>
|
333
357
|
|
334
358
|
|
335
|
-
<li class="
|
359
|
+
<li class="even ">
|
336
360
|
<div class="item">
|
337
361
|
<span class='object_link'><a href="AzureSTT/Models/File.html#id-instance_method" title="AzureSTT::Models::File#id (method)">#id</a></span>
|
338
362
|
<small>AzureSTT::Models::File</small>
|
@@ -340,7 +364,7 @@
|
|
340
364
|
</li>
|
341
365
|
|
342
366
|
|
343
|
-
<li class="
|
367
|
+
<li class="odd ">
|
344
368
|
<div class="item">
|
345
369
|
<span class='object_link'><a href="AzureSTT/Models/Transcription.html#id-instance_method" title="AzureSTT::Models::Transcription#id (method)">#id</a></span>
|
346
370
|
<small>AzureSTT::Models::Transcription</small>
|
@@ -348,7 +372,7 @@
|
|
348
372
|
</li>
|
349
373
|
|
350
374
|
|
351
|
-
<li class="
|
375
|
+
<li class="even ">
|
352
376
|
<div class="item">
|
353
377
|
<span class='object_link'><a href="AzureSTT/Client.html#initialize-instance_method" title="AzureSTT::Client#initialize (method)">#initialize</a></span>
|
354
378
|
<small>AzureSTT::Client</small>
|
@@ -356,10 +380,18 @@
|
|
356
380
|
</li>
|
357
381
|
|
358
382
|
|
383
|
+
<li class="odd ">
|
384
|
+
<div class="item">
|
385
|
+
<span class='object_link'><a href="AzureSTT/ServiceError.html#initialize-instance_method" title="AzureSTT::ServiceError#initialize (method)">#initialize</a></span>
|
386
|
+
<small>AzureSTT::ServiceError</small>
|
387
|
+
</div>
|
388
|
+
</li>
|
389
|
+
|
390
|
+
|
359
391
|
<li class="even ">
|
360
392
|
<div class="item">
|
361
|
-
<span class='object_link'><a href="AzureSTT/
|
362
|
-
<small>AzureSTT::
|
393
|
+
<span class='object_link'><a href="AzureSTT/NetError.html#initialize-instance_method" title="AzureSTT::NetError#initialize (method)">#initialize</a></span>
|
394
|
+
<small>AzureSTT::NetError</small>
|
363
395
|
</div>
|
364
396
|
</li>
|
365
397
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.34
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -100,9 +100,9 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on
|
104
|
-
<a href="
|
105
|
-
0.9.
|
103
|
+
Generated on Wed May 10 12:30:20 2023 by
|
104
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
|
+
0.9.34 (ruby-2.7.7).
|
106
106
|
</div>
|
107
107
|
|
108
108
|
</div>
|
data/lib/azure_stt/client.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'httparty'
|
4
|
-
|
5
4
|
module AzureSTT
|
6
5
|
#
|
7
6
|
# Client class that uses HTTParty to communicate with the API
|
@@ -20,13 +19,13 @@ module AzureSTT
|
|
20
19
|
def initialize(region:, subscription_key:)
|
21
20
|
@subscription_key = subscription_key
|
22
21
|
@region = region
|
23
|
-
self.class.base_uri "https://#{region}.api.cognitive.microsoft.com/speechtotext/v3.
|
22
|
+
self.class.base_uri "https://#{region}.api.cognitive.microsoft.com/speechtotext/v3.1"
|
24
23
|
end
|
25
24
|
|
26
25
|
#
|
27
26
|
# Create a transcription for a batch or a single file.
|
28
27
|
#
|
29
|
-
# @see https://francecentral.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
28
|
+
# @see https://francecentral.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/CreateTranscription
|
30
29
|
#
|
31
30
|
# @param [Hash] args
|
32
31
|
#
|
@@ -92,7 +91,7 @@ module AzureSTT
|
|
92
91
|
#
|
93
92
|
# Get an array containing the files for a given transcription
|
94
93
|
#
|
95
|
-
# @see https://uscentral.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
94
|
+
# @see https://uscentral.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/GetTranscriptionFiles
|
96
95
|
#
|
97
96
|
# @param [Integer] id The identifier of the transcription
|
98
97
|
#
|
@@ -147,9 +146,10 @@ module AzureSTT
|
|
147
146
|
#
|
148
147
|
# @return [HTTParty::Response]
|
149
148
|
#
|
150
|
-
def get(path, parameters =
|
149
|
+
def get(path, parameters = nil)
|
151
150
|
options = {
|
152
|
-
headers: headers
|
151
|
+
headers: headers,
|
152
|
+
query: parameters
|
153
153
|
}.compact
|
154
154
|
|
155
155
|
response = self.class.get(path, options)
|
@@ -177,12 +177,13 @@ module AzureSTT
|
|
177
177
|
if response.request.format == :json
|
178
178
|
raise ServiceError.new(
|
179
179
|
code: response.code,
|
180
|
-
message: response
|
180
|
+
message: response['code'] || response.message,
|
181
|
+
azure_message: response['message'] || response.dig('error', 'message')
|
181
182
|
)
|
182
183
|
else
|
183
184
|
raise NetError.new(
|
184
185
|
code: response.code,
|
185
|
-
message: response.
|
186
|
+
message: response.message
|
186
187
|
)
|
187
188
|
end
|
188
189
|
end
|
data/lib/azure_stt/errors.rb
CHANGED
@@ -4,22 +4,29 @@ module AzureSTT
|
|
4
4
|
#
|
5
5
|
# Top level error for AzureSTT specific errors
|
6
6
|
#
|
7
|
-
class Error < StandardError
|
7
|
+
class Error < StandardError; end
|
8
|
+
|
9
|
+
#
|
10
|
+
# Error raised when there is an error 400
|
11
|
+
#
|
12
|
+
class ServiceError < Error
|
8
13
|
attr_reader :code
|
9
14
|
|
10
|
-
def initialize(code:, message:)
|
15
|
+
def initialize(code:, message:, azure_message:)
|
11
16
|
@code = code
|
12
|
-
super("#{message} (#{code})")
|
17
|
+
super("#{message} (#{code}): #{azure_message}")
|
13
18
|
end
|
14
19
|
end
|
15
20
|
|
16
|
-
#
|
17
|
-
# Error raised when there is an error 400
|
18
|
-
#
|
19
|
-
class ServiceError < Error; end
|
20
|
-
|
21
21
|
#
|
22
22
|
# Error raised when there is an error 500
|
23
23
|
#
|
24
|
-
class NetError < Error
|
24
|
+
class NetError < Error
|
25
|
+
attr_reader :code
|
26
|
+
|
27
|
+
def initialize(code:, message:)
|
28
|
+
@code = code
|
29
|
+
super("#{message} (#{code})")
|
30
|
+
end
|
31
|
+
end
|
25
32
|
end
|
@@ -5,7 +5,7 @@ module AzureSTT
|
|
5
5
|
#
|
6
6
|
# Model class to represent files in our models
|
7
7
|
#
|
8
|
-
# @see https://francecentral.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
8
|
+
# @see https://francecentral.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/GetTranscriptionFiles/console
|
9
9
|
#
|
10
10
|
class File < Base
|
11
11
|
#
|
@@ -123,7 +123,7 @@ module AzureSTT
|
|
123
123
|
#
|
124
124
|
# Get the report of a transcription from transcriptions/id/files route
|
125
125
|
#
|
126
|
-
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
126
|
+
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/GetTranscriptionFiles/console
|
127
127
|
#
|
128
128
|
# @return [Models::Report]
|
129
129
|
#
|
data/lib/azure_stt/session.rb
CHANGED
@@ -25,7 +25,7 @@ module AzureSTT
|
|
25
25
|
#
|
26
26
|
# Create a transcription by calling the API.
|
27
27
|
#
|
28
|
-
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
28
|
+
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/CreateTranscription
|
29
29
|
#
|
30
30
|
# @param [Array[String]] content_urls The urls of your files
|
31
31
|
# @param [Hash] properties The properties you want to use for the
|
@@ -38,12 +38,10 @@ module AzureSTT
|
|
38
38
|
#
|
39
39
|
def create_transcription(content_urls:, properties:, locale:, display_name:)
|
40
40
|
transcription_hash = client.create_transcription(
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
displayName: display_name
|
46
|
-
}
|
41
|
+
contentUrls: content_urls,
|
42
|
+
properties: properties,
|
43
|
+
locale: locale,
|
44
|
+
displayName: display_name
|
47
45
|
)
|
48
46
|
build_transcription_from_hash(transcription_hash)
|
49
47
|
end
|
@@ -51,7 +49,7 @@ module AzureSTT
|
|
51
49
|
#
|
52
50
|
# Get a transcription identified by an id.
|
53
51
|
#
|
54
|
-
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
52
|
+
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/GetTranscription
|
55
53
|
#
|
56
54
|
# @param [String] id The identifier of the transcription
|
57
55
|
#
|
@@ -65,7 +63,7 @@ module AzureSTT
|
|
65
63
|
#
|
66
64
|
# Get multiple transcriptions.
|
67
65
|
#
|
68
|
-
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
66
|
+
# @see https://centralus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/GetTranscriptions
|
69
67
|
#
|
70
68
|
# @param [Integer] skip Number of transcriptions that will be skipped (optional)
|
71
69
|
# @param [Integer] top Number of transcriptions that will be included after skipping
|
@@ -84,7 +82,7 @@ module AzureSTT
|
|
84
82
|
# Delete an API transcription with a given ID. The transcription will not
|
85
83
|
# exist anymore in the API, therefore you won't be able to retrieve it.
|
86
84
|
#
|
87
|
-
# @see https://westus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-
|
85
|
+
# @see https://westus.dev.cognitive.microsoft.com/docs/services/speech-to-text-api-v3-1/operations/DeleteTranscription
|
88
86
|
#
|
89
87
|
# @param [String] id The id of the transcription in the API
|
90
88
|
#
|
data/lib/azure_stt/version.rb
CHANGED
data/lib/azure_stt.rb
CHANGED
@@ -15,6 +15,6 @@ require_relative 'azure_stt/parsers'
|
|
15
15
|
require_relative 'azure_stt/session'
|
16
16
|
|
17
17
|
AzureSTT.configure do |config|
|
18
|
-
config.subscription_key = ENV
|
19
|
-
config.region = ENV
|
18
|
+
config.subscription_key = ENV.fetch('SUBSCRIPTION_KEY', nil)
|
19
|
+
config.region = ENV.fetch('REGION', 'uscentral')
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure_stt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- François Pouly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -38,29 +38,25 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.17'
|
41
|
-
description: API Wrapper for the Microsoft Translator Text API 3.
|
41
|
+
description: API Wrapper for the Microsoft Translator Text API 3.1 (Cognitive Services)
|
42
42
|
email:
|
43
43
|
- francois.pouly@perfect-memory.com
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- ".github/dependabot.yml"
|
49
48
|
- ".github/workflows/ci.yml"
|
50
49
|
- ".gitignore"
|
51
50
|
- ".rubocop.yml"
|
52
51
|
- CHANGELOG.md
|
53
52
|
- CODE_OF_CONDUCT.md
|
54
53
|
- Gemfile
|
55
|
-
- Gemfile.lock
|
56
54
|
- LICENSE
|
57
55
|
- README.md
|
58
56
|
- Rakefile
|
59
57
|
- azure_stt.gemspec
|
60
58
|
- bin/console
|
61
59
|
- bin/setup
|
62
|
-
- docs/AzureBatchTranscription.html
|
63
|
-
- docs/AzureBatchTranscription/Configuration.html
|
64
60
|
- docs/AzureSTT.html
|
65
61
|
- docs/AzureSTT/Client.html
|
66
62
|
- docs/AzureSTT/Configuration.html
|
@@ -88,7 +84,6 @@ files:
|
|
88
84
|
- docs/AzureSTT/Parsers/Word.html
|
89
85
|
- docs/AzureSTT/ServiceError.html
|
90
86
|
- docs/AzureSTT/Session.html
|
91
|
-
- docs/AzureSTT/Transcription.html
|
92
87
|
- docs/AzureSTT/Types.html
|
93
88
|
- docs/AzureStt_.html
|
94
89
|
- docs/_index.html
|
@@ -135,7 +130,8 @@ files:
|
|
135
130
|
homepage: https://github.com/PerfectMemory/azure_stt
|
136
131
|
licenses:
|
137
132
|
- MIT
|
138
|
-
metadata:
|
133
|
+
metadata:
|
134
|
+
rubygems_mfa_required: 'true'
|
139
135
|
post_install_message:
|
140
136
|
rdoc_options: []
|
141
137
|
require_paths:
|
@@ -151,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
147
|
- !ruby/object:Gem::Version
|
152
148
|
version: '0'
|
153
149
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.1.6
|
155
151
|
signing_key:
|
156
152
|
specification_version: 4
|
157
|
-
summary: API Wrapper for the Microsoft Translator Text API 3.
|
153
|
+
summary: API Wrapper for the Microsoft Translator Text API 3.1
|
158
154
|
test_files: []
|