assemblyai 1.0.2 → 1.2.0
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/assemblyai/lemur/types/lemur_model.rb +1 -0
- data/lib/assemblyai/transcripts/client.rb +349 -153
- data/lib/assemblyai/transcripts/polling_client.rb +148 -70
- data/lib/assemblyai/transcripts/types/content_safety_labels_result.rb +2 -2
- data/lib/assemblyai/transcripts/types/paragraphs_response.rb +8 -8
- data/lib/assemblyai/transcripts/types/sentences_response.rb +8 -8
- data/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb +12 -1
- data/lib/assemblyai/transcripts/types/topic_detection_result.rb +2 -2
- data/lib/assemblyai/transcripts/types/transcript.rb +98 -56
- data/lib/assemblyai/transcripts/types/transcript_boost_param.rb +1 -1
- data/lib/assemblyai/transcripts/types/transcript_list.rb +4 -4
- data/lib/assemblyai/transcripts/types/transcript_list_item.rb +15 -15
- data/lib/assemblyai/transcripts/types/transcript_optional_params.rb +64 -38
- data/lib/assemblyai/transcripts/types/transcript_paragraph.rb +12 -32
- data/lib/assemblyai/transcripts/types/transcript_sentence.rb +22 -11
- data/lib/assemblyai/transcripts/types/transcript_utterance.rb +14 -2
- data/lib/assemblyai/transcripts/types/transcript_word.rb +21 -11
- data/lib/gemconfig.rb +1 -1
- metadata +2 -2
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require_relative "transcript_status"
|
4
4
|
require_relative "transcript_language_code"
|
5
|
+
require_relative "speech_model"
|
5
6
|
require_relative "transcript_word"
|
6
7
|
require_relative "transcript_utterance"
|
7
|
-
require_relative "speech_model"
|
8
8
|
require_relative "auto_highlights_result"
|
9
9
|
require_relative "redact_pii_audio_quality"
|
10
10
|
require_relative "pii_policy"
|
@@ -24,10 +24,8 @@ module AssemblyAI
|
|
24
24
|
class Transcript
|
25
25
|
# @return [String] The unique identifier of your transcript
|
26
26
|
attr_reader :id
|
27
|
-
# @return [String] The
|
28
|
-
attr_reader :
|
29
|
-
# @return [String] The acoustic model that was used for the transcript
|
30
|
-
attr_reader :acoustic_model
|
27
|
+
# @return [String] The URL of the media that was transcribed
|
28
|
+
attr_reader :audio_url
|
31
29
|
# @return [AssemblyAI::Transcripts::TranscriptStatus] The status of your transcript. Possible values are queued, processing,
|
32
30
|
# completed, or error.
|
33
31
|
attr_reader :status
|
@@ -36,8 +34,18 @@ module AssemblyAI
|
|
36
34
|
# Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
37
35
|
# The default value is 'en_us'.
|
38
36
|
attr_reader :language_code
|
39
|
-
# @return [
|
40
|
-
|
37
|
+
# @return [Boolean] Whether [Automatic language
|
38
|
+
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
39
|
+
# is enabled, either true or false
|
40
|
+
attr_reader :language_detection
|
41
|
+
# @return [Float] The confidence threshold for the automatically detected language.
|
42
|
+
# An error will be returned if the language confidence is below this threshold.
|
43
|
+
attr_reader :language_confidence_threshold
|
44
|
+
# @return [Float] The confidence score for the detected language, between 0.0 (low confidence) and
|
45
|
+
# 1.0 (high confidence)
|
46
|
+
attr_reader :language_confidence
|
47
|
+
# @return [AssemblyAI::Transcripts::SpeechModel]
|
48
|
+
attr_reader :speech_model
|
41
49
|
# @return [String] The textual transcript of your media file
|
42
50
|
attr_reader :text
|
43
51
|
# @return [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of temporally-sequential word objects, one for each word in the
|
@@ -61,12 +69,19 @@ module AssemblyAI
|
|
61
69
|
attr_reader :punctuate
|
62
70
|
# @return [Boolean] Whether Text Formatting is enabled, either true or false
|
63
71
|
attr_reader :format_text
|
72
|
+
# @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
73
|
+
attr_reader :disfluencies
|
74
|
+
# @return [Boolean] Whether [Multichannel
|
75
|
+
# ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
|
76
|
+
# was enabled in the transcription request, either true or false
|
77
|
+
attr_reader :multichannel
|
78
|
+
# @return [Integer] The number of audio channels in the audio file. This is only present when
|
79
|
+
# multichannel is enabled.
|
80
|
+
attr_reader :audio_channels
|
64
81
|
# @return [Boolean] Whether [Dual channel
|
65
82
|
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
|
66
83
|
# was enabled in the transcription request, either true or false
|
67
84
|
attr_reader :dual_channel
|
68
|
-
# @return [AssemblyAI::Transcripts::SpeechModel]
|
69
|
-
attr_reader :speech_model
|
70
85
|
# @return [String] The URL to which we send webhook requests.
|
71
86
|
# We sends two different types of webhook requests.
|
72
87
|
# One request when a transcript is completed or failed, and one request when the
|
@@ -140,10 +155,6 @@ module AssemblyAI
|
|
140
155
|
attr_reader :iab_categories
|
141
156
|
# @return [AssemblyAI::Transcripts::TopicDetectionModelResult]
|
142
157
|
attr_reader :iab_categories_result
|
143
|
-
# @return [Boolean] Whether [Automatic language
|
144
|
-
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
145
|
-
# is enabled, either true or false
|
146
|
-
attr_reader :language_detection
|
147
158
|
# @return [Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>] Customize how words are spelled and formatted using to and from values
|
148
159
|
attr_reader :custom_spelling
|
149
160
|
# @return [Boolean] Whether [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters) is
|
@@ -168,8 +179,6 @@ module AssemblyAI
|
|
168
179
|
attr_reader :custom_topics
|
169
180
|
# @return [Array<String>] The list of custom topics provided if custom topics is enabled
|
170
181
|
attr_reader :topics
|
171
|
-
# @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
172
|
-
attr_reader :disfluencies
|
173
182
|
# @return [Boolean] Whether [Sentiment
|
174
183
|
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) is enabled,
|
175
184
|
# can be true or false
|
@@ -196,6 +205,10 @@ module AssemblyAI
|
|
196
205
|
attr_reader :throttled
|
197
206
|
# @return [String] Error message of why the transcript failed
|
198
207
|
attr_reader :error
|
208
|
+
# @return [String] The language model that was used for the transcript
|
209
|
+
attr_reader :language_model
|
210
|
+
# @return [String] The acoustic model that was used for the transcript
|
211
|
+
attr_reader :acoustic_model
|
199
212
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
200
213
|
attr_reader :additional_properties
|
201
214
|
# @return [Object]
|
@@ -205,15 +218,21 @@ module AssemblyAI
|
|
205
218
|
OMIT = Object.new
|
206
219
|
|
207
220
|
# @param id [String] The unique identifier of your transcript
|
208
|
-
# @param
|
209
|
-
# @param acoustic_model [String] The acoustic model that was used for the transcript
|
221
|
+
# @param audio_url [String] The URL of the media that was transcribed
|
210
222
|
# @param status [AssemblyAI::Transcripts::TranscriptStatus] The status of your transcript. Possible values are queued, processing,
|
211
223
|
# completed, or error.
|
212
224
|
# @param language_code [AssemblyAI::Transcripts::TranscriptLanguageCode] The language of your audio file.
|
213
225
|
# Possible values are found in [Supported
|
214
226
|
# Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
215
227
|
# The default value is 'en_us'.
|
216
|
-
# @param
|
228
|
+
# @param language_detection [Boolean] Whether [Automatic language
|
229
|
+
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
230
|
+
# is enabled, either true or false
|
231
|
+
# @param language_confidence_threshold [Float] The confidence threshold for the automatically detected language.
|
232
|
+
# An error will be returned if the language confidence is below this threshold.
|
233
|
+
# @param language_confidence [Float] The confidence score for the detected language, between 0.0 (low confidence) and
|
234
|
+
# 1.0 (high confidence)
|
235
|
+
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
|
217
236
|
# @param text [String] The textual transcript of your media file
|
218
237
|
# @param words [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of temporally-sequential word objects, one for each word in the
|
219
238
|
# transcript.
|
@@ -230,10 +249,15 @@ module AssemblyAI
|
|
230
249
|
# @param audio_duration [Integer] The duration of this transcript object's media file, in seconds
|
231
250
|
# @param punctuate [Boolean] Whether Automatic Punctuation is enabled, either true or false
|
232
251
|
# @param format_text [Boolean] Whether Text Formatting is enabled, either true or false
|
252
|
+
# @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
253
|
+
# @param multichannel [Boolean] Whether [Multichannel
|
254
|
+
# ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
|
255
|
+
# was enabled in the transcription request, either true or false
|
256
|
+
# @param audio_channels [Integer] The number of audio channels in the audio file. This is only present when
|
257
|
+
# multichannel is enabled.
|
233
258
|
# @param dual_channel [Boolean] Whether [Dual channel
|
234
259
|
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
|
235
260
|
# was enabled in the transcription request, either true or false
|
236
|
-
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
|
237
261
|
# @param webhook_url [String] The URL to which we send webhook requests.
|
238
262
|
# We sends two different types of webhook requests.
|
239
263
|
# One request when a transcript is completed or failed, and one request when the
|
@@ -284,9 +308,6 @@ module AssemblyAI
|
|
284
308
|
# Detection](https://www.assemblyai.com/docs/models/topic-detection) is enabled,
|
285
309
|
# can be true or false
|
286
310
|
# @param iab_categories_result [AssemblyAI::Transcripts::TopicDetectionModelResult]
|
287
|
-
# @param language_detection [Boolean] Whether [Automatic language
|
288
|
-
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
289
|
-
# is enabled, either true or false
|
290
311
|
# @param custom_spelling [Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>] Customize how words are spelled and formatted using to and from values
|
291
312
|
# @param auto_chapters [Boolean] Whether [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters) is
|
292
313
|
# enabled, can be true or false
|
@@ -302,7 +323,6 @@ module AssemblyAI
|
|
302
323
|
# [Summarization](https://www.assemblyai.com/docs/models/summarization) is enabled
|
303
324
|
# @param custom_topics [Boolean] Whether custom topics is enabled, either true or false
|
304
325
|
# @param topics [Array<String>] The list of custom topics provided if custom topics is enabled
|
305
|
-
# @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
306
326
|
# @param sentiment_analysis [Boolean] Whether [Sentiment
|
307
327
|
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) is enabled,
|
308
328
|
# can be true or false
|
@@ -322,16 +342,20 @@ module AssemblyAI
|
|
322
342
|
# @param throttled [Boolean] True while a request is throttled and false when a request is no longer
|
323
343
|
# throttled
|
324
344
|
# @param error [String] Error message of why the transcript failed
|
345
|
+
# @param language_model [String] The language model that was used for the transcript
|
346
|
+
# @param acoustic_model [String] The acoustic model that was used for the transcript
|
325
347
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
326
348
|
# @return [AssemblyAI::Transcripts::Transcript]
|
327
|
-
def initialize(id:,
|
328
|
-
words: OMIT, utterances: OMIT, confidence: OMIT, audio_duration: OMIT, punctuate: OMIT, format_text: OMIT,
|
349
|
+
def initialize(id:, audio_url:, status:, webhook_auth:, auto_highlights:, redact_pii:, summarization:, language_model:, acoustic_model:, language_code: OMIT, language_detection: OMIT,
|
350
|
+
language_confidence_threshold: OMIT, language_confidence: OMIT, speech_model: OMIT, text: OMIT, words: OMIT, utterances: OMIT, confidence: OMIT, audio_duration: OMIT, punctuate: OMIT, format_text: OMIT, disfluencies: OMIT, multichannel: OMIT, audio_channels: OMIT, dual_channel: OMIT, webhook_url: OMIT, webhook_status_code: OMIT, webhook_auth_header_name: OMIT, speed_boost: OMIT, auto_highlights_result: OMIT, audio_start_from: OMIT, audio_end_at: OMIT, word_boost: OMIT, boost_param: OMIT, filter_profanity: OMIT, redact_pii_audio: OMIT, redact_pii_audio_quality: OMIT, redact_pii_policies: OMIT, redact_pii_sub: OMIT, speaker_labels: OMIT, speakers_expected: OMIT, content_safety: OMIT, content_safety_labels: OMIT, iab_categories: OMIT, iab_categories_result: OMIT, custom_spelling: OMIT, auto_chapters: OMIT, chapters: OMIT, summary_type: OMIT, summary_model: OMIT, summary: OMIT, custom_topics: OMIT, topics: OMIT, sentiment_analysis: OMIT, sentiment_analysis_results: OMIT, entity_detection: OMIT, entities: OMIT, speech_threshold: OMIT, throttled: OMIT, error: OMIT, additional_properties: nil)
|
329
351
|
@id = id
|
330
|
-
@
|
331
|
-
@acoustic_model = acoustic_model
|
352
|
+
@audio_url = audio_url
|
332
353
|
@status = status
|
333
354
|
@language_code = language_code if language_code != OMIT
|
334
|
-
@
|
355
|
+
@language_detection = language_detection if language_detection != OMIT
|
356
|
+
@language_confidence_threshold = language_confidence_threshold if language_confidence_threshold != OMIT
|
357
|
+
@language_confidence = language_confidence if language_confidence != OMIT
|
358
|
+
@speech_model = speech_model if speech_model != OMIT
|
335
359
|
@text = text if text != OMIT
|
336
360
|
@words = words if words != OMIT
|
337
361
|
@utterances = utterances if utterances != OMIT
|
@@ -339,8 +363,10 @@ module AssemblyAI
|
|
339
363
|
@audio_duration = audio_duration if audio_duration != OMIT
|
340
364
|
@punctuate = punctuate if punctuate != OMIT
|
341
365
|
@format_text = format_text if format_text != OMIT
|
366
|
+
@disfluencies = disfluencies if disfluencies != OMIT
|
367
|
+
@multichannel = multichannel if multichannel != OMIT
|
368
|
+
@audio_channels = audio_channels if audio_channels != OMIT
|
342
369
|
@dual_channel = dual_channel if dual_channel != OMIT
|
343
|
-
@speech_model = speech_model if speech_model != OMIT
|
344
370
|
@webhook_url = webhook_url if webhook_url != OMIT
|
345
371
|
@webhook_status_code = webhook_status_code if webhook_status_code != OMIT
|
346
372
|
@webhook_auth = webhook_auth
|
@@ -364,7 +390,6 @@ module AssemblyAI
|
|
364
390
|
@content_safety_labels = content_safety_labels if content_safety_labels != OMIT
|
365
391
|
@iab_categories = iab_categories if iab_categories != OMIT
|
366
392
|
@iab_categories_result = iab_categories_result if iab_categories_result != OMIT
|
367
|
-
@language_detection = language_detection if language_detection != OMIT
|
368
393
|
@custom_spelling = custom_spelling if custom_spelling != OMIT
|
369
394
|
@auto_chapters = auto_chapters if auto_chapters != OMIT
|
370
395
|
@chapters = chapters if chapters != OMIT
|
@@ -374,7 +399,6 @@ module AssemblyAI
|
|
374
399
|
@summary = summary if summary != OMIT
|
375
400
|
@custom_topics = custom_topics if custom_topics != OMIT
|
376
401
|
@topics = topics if topics != OMIT
|
377
|
-
@disfluencies = disfluencies if disfluencies != OMIT
|
378
402
|
@sentiment_analysis = sentiment_analysis if sentiment_analysis != OMIT
|
379
403
|
@sentiment_analysis_results = sentiment_analysis_results if sentiment_analysis_results != OMIT
|
380
404
|
@entity_detection = entity_detection if entity_detection != OMIT
|
@@ -382,14 +406,18 @@ module AssemblyAI
|
|
382
406
|
@speech_threshold = speech_threshold if speech_threshold != OMIT
|
383
407
|
@throttled = throttled if throttled != OMIT
|
384
408
|
@error = error if error != OMIT
|
409
|
+
@language_model = language_model
|
410
|
+
@acoustic_model = acoustic_model
|
385
411
|
@additional_properties = additional_properties
|
386
412
|
@_field_set = {
|
387
413
|
"id": id,
|
388
|
-
"
|
389
|
-
"acoustic_model": acoustic_model,
|
414
|
+
"audio_url": audio_url,
|
390
415
|
"status": status,
|
391
416
|
"language_code": language_code,
|
392
|
-
"
|
417
|
+
"language_detection": language_detection,
|
418
|
+
"language_confidence_threshold": language_confidence_threshold,
|
419
|
+
"language_confidence": language_confidence,
|
420
|
+
"speech_model": speech_model,
|
393
421
|
"text": text,
|
394
422
|
"words": words,
|
395
423
|
"utterances": utterances,
|
@@ -397,8 +425,10 @@ module AssemblyAI
|
|
397
425
|
"audio_duration": audio_duration,
|
398
426
|
"punctuate": punctuate,
|
399
427
|
"format_text": format_text,
|
428
|
+
"disfluencies": disfluencies,
|
429
|
+
"multichannel": multichannel,
|
430
|
+
"audio_channels": audio_channels,
|
400
431
|
"dual_channel": dual_channel,
|
401
|
-
"speech_model": speech_model,
|
402
432
|
"webhook_url": webhook_url,
|
403
433
|
"webhook_status_code": webhook_status_code,
|
404
434
|
"webhook_auth": webhook_auth,
|
@@ -422,7 +452,6 @@ module AssemblyAI
|
|
422
452
|
"content_safety_labels": content_safety_labels,
|
423
453
|
"iab_categories": iab_categories,
|
424
454
|
"iab_categories_result": iab_categories_result,
|
425
|
-
"language_detection": language_detection,
|
426
455
|
"custom_spelling": custom_spelling,
|
427
456
|
"auto_chapters": auto_chapters,
|
428
457
|
"chapters": chapters,
|
@@ -432,14 +461,15 @@ module AssemblyAI
|
|
432
461
|
"summary": summary,
|
433
462
|
"custom_topics": custom_topics,
|
434
463
|
"topics": topics,
|
435
|
-
"disfluencies": disfluencies,
|
436
464
|
"sentiment_analysis": sentiment_analysis,
|
437
465
|
"sentiment_analysis_results": sentiment_analysis_results,
|
438
466
|
"entity_detection": entity_detection,
|
439
467
|
"entities": entities,
|
440
468
|
"speech_threshold": speech_threshold,
|
441
469
|
"throttled": throttled,
|
442
|
-
"error": error
|
470
|
+
"error": error,
|
471
|
+
"language_model": language_model,
|
472
|
+
"acoustic_model": acoustic_model
|
443
473
|
}.reject do |_k, v|
|
444
474
|
v == OMIT
|
445
475
|
end
|
@@ -453,11 +483,13 @@ module AssemblyAI
|
|
453
483
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
454
484
|
parsed_json = JSON.parse(json_object)
|
455
485
|
id = struct["id"]
|
456
|
-
|
457
|
-
acoustic_model = struct["acoustic_model"]
|
486
|
+
audio_url = struct["audio_url"]
|
458
487
|
status = struct["status"]
|
459
488
|
language_code = struct["language_code"]
|
460
|
-
|
489
|
+
language_detection = struct["language_detection"]
|
490
|
+
language_confidence_threshold = struct["language_confidence_threshold"]
|
491
|
+
language_confidence = struct["language_confidence"]
|
492
|
+
speech_model = struct["speech_model"]
|
461
493
|
text = struct["text"]
|
462
494
|
words = parsed_json["words"]&.map do |v|
|
463
495
|
v = v.to_json
|
@@ -471,8 +503,10 @@ module AssemblyAI
|
|
471
503
|
audio_duration = struct["audio_duration"]
|
472
504
|
punctuate = struct["punctuate"]
|
473
505
|
format_text = struct["format_text"]
|
506
|
+
disfluencies = struct["disfluencies"]
|
507
|
+
multichannel = struct["multichannel"]
|
508
|
+
audio_channels = struct["audio_channels"]
|
474
509
|
dual_channel = struct["dual_channel"]
|
475
|
-
speech_model = struct["speech_model"]
|
476
510
|
webhook_url = struct["webhook_url"]
|
477
511
|
webhook_status_code = struct["webhook_status_code"]
|
478
512
|
webhook_auth = struct["webhook_auth"]
|
@@ -511,7 +545,6 @@ module AssemblyAI
|
|
511
545
|
iab_categories_result = parsed_json["iab_categories_result"].to_json
|
512
546
|
iab_categories_result = AssemblyAI::Transcripts::TopicDetectionModelResult.from_json(json_object: iab_categories_result)
|
513
547
|
end
|
514
|
-
language_detection = struct["language_detection"]
|
515
548
|
custom_spelling = parsed_json["custom_spelling"]&.map do |v|
|
516
549
|
v = v.to_json
|
517
550
|
AssemblyAI::Transcripts::TranscriptCustomSpelling.from_json(json_object: v)
|
@@ -527,7 +560,6 @@ module AssemblyAI
|
|
527
560
|
summary = struct["summary"]
|
528
561
|
custom_topics = struct["custom_topics"]
|
529
562
|
topics = struct["topics"]
|
530
|
-
disfluencies = struct["disfluencies"]
|
531
563
|
sentiment_analysis = struct["sentiment_analysis"]
|
532
564
|
sentiment_analysis_results = parsed_json["sentiment_analysis_results"]&.map do |v|
|
533
565
|
v = v.to_json
|
@@ -541,13 +573,17 @@ module AssemblyAI
|
|
541
573
|
speech_threshold = struct["speech_threshold"]
|
542
574
|
throttled = struct["throttled"]
|
543
575
|
error = struct["error"]
|
576
|
+
language_model = struct["language_model"]
|
577
|
+
acoustic_model = struct["acoustic_model"]
|
544
578
|
new(
|
545
579
|
id: id,
|
546
|
-
|
547
|
-
acoustic_model: acoustic_model,
|
580
|
+
audio_url: audio_url,
|
548
581
|
status: status,
|
549
582
|
language_code: language_code,
|
550
|
-
|
583
|
+
language_detection: language_detection,
|
584
|
+
language_confidence_threshold: language_confidence_threshold,
|
585
|
+
language_confidence: language_confidence,
|
586
|
+
speech_model: speech_model,
|
551
587
|
text: text,
|
552
588
|
words: words,
|
553
589
|
utterances: utterances,
|
@@ -555,8 +591,10 @@ module AssemblyAI
|
|
555
591
|
audio_duration: audio_duration,
|
556
592
|
punctuate: punctuate,
|
557
593
|
format_text: format_text,
|
594
|
+
disfluencies: disfluencies,
|
595
|
+
multichannel: multichannel,
|
596
|
+
audio_channels: audio_channels,
|
558
597
|
dual_channel: dual_channel,
|
559
|
-
speech_model: speech_model,
|
560
598
|
webhook_url: webhook_url,
|
561
599
|
webhook_status_code: webhook_status_code,
|
562
600
|
webhook_auth: webhook_auth,
|
@@ -580,7 +618,6 @@ module AssemblyAI
|
|
580
618
|
content_safety_labels: content_safety_labels,
|
581
619
|
iab_categories: iab_categories,
|
582
620
|
iab_categories_result: iab_categories_result,
|
583
|
-
language_detection: language_detection,
|
584
621
|
custom_spelling: custom_spelling,
|
585
622
|
auto_chapters: auto_chapters,
|
586
623
|
chapters: chapters,
|
@@ -590,7 +627,6 @@ module AssemblyAI
|
|
590
627
|
summary: summary,
|
591
628
|
custom_topics: custom_topics,
|
592
629
|
topics: topics,
|
593
|
-
disfluencies: disfluencies,
|
594
630
|
sentiment_analysis: sentiment_analysis,
|
595
631
|
sentiment_analysis_results: sentiment_analysis_results,
|
596
632
|
entity_detection: entity_detection,
|
@@ -598,6 +634,8 @@ module AssemblyAI
|
|
598
634
|
speech_threshold: speech_threshold,
|
599
635
|
throttled: throttled,
|
600
636
|
error: error,
|
637
|
+
language_model: language_model,
|
638
|
+
acoustic_model: acoustic_model,
|
601
639
|
additional_properties: struct
|
602
640
|
)
|
603
641
|
end
|
@@ -617,11 +655,13 @@ module AssemblyAI
|
|
617
655
|
# @return [Void]
|
618
656
|
def self.validate_raw(obj:)
|
619
657
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
620
|
-
obj.
|
621
|
-
obj.acoustic_model.is_a?(String) != false || raise("Passed value for field obj.acoustic_model is not the expected type, validation failed.")
|
658
|
+
obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
|
622
659
|
obj.status.is_a?(AssemblyAI::Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
623
660
|
obj.language_code&.is_a?(AssemblyAI::Transcripts::TranscriptLanguageCode) != false || raise("Passed value for field obj.language_code is not the expected type, validation failed.")
|
624
|
-
obj.
|
661
|
+
obj.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
|
662
|
+
obj.language_confidence_threshold&.is_a?(Float) != false || raise("Passed value for field obj.language_confidence_threshold is not the expected type, validation failed.")
|
663
|
+
obj.language_confidence&.is_a?(Float) != false || raise("Passed value for field obj.language_confidence is not the expected type, validation failed.")
|
664
|
+
obj.speech_model&.is_a?(AssemblyAI::Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
|
625
665
|
obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
626
666
|
obj.words&.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
|
627
667
|
obj.utterances&.is_a?(Array) != false || raise("Passed value for field obj.utterances is not the expected type, validation failed.")
|
@@ -629,8 +669,10 @@ module AssemblyAI
|
|
629
669
|
obj.audio_duration&.is_a?(Integer) != false || raise("Passed value for field obj.audio_duration is not the expected type, validation failed.")
|
630
670
|
obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.")
|
631
671
|
obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.")
|
672
|
+
obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
|
673
|
+
obj.multichannel&.is_a?(Boolean) != false || raise("Passed value for field obj.multichannel is not the expected type, validation failed.")
|
674
|
+
obj.audio_channels&.is_a?(Integer) != false || raise("Passed value for field obj.audio_channels is not the expected type, validation failed.")
|
632
675
|
obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.")
|
633
|
-
obj.speech_model&.is_a?(AssemblyAI::Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
|
634
676
|
obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.")
|
635
677
|
obj.webhook_status_code&.is_a?(Integer) != false || raise("Passed value for field obj.webhook_status_code is not the expected type, validation failed.")
|
636
678
|
obj.webhook_auth.is_a?(Boolean) != false || raise("Passed value for field obj.webhook_auth is not the expected type, validation failed.")
|
@@ -654,7 +696,6 @@ module AssemblyAI
|
|
654
696
|
obj.content_safety_labels.nil? || AssemblyAI::Transcripts::ContentSafetyLabelsResult.validate_raw(obj: obj.content_safety_labels)
|
655
697
|
obj.iab_categories&.is_a?(Boolean) != false || raise("Passed value for field obj.iab_categories is not the expected type, validation failed.")
|
656
698
|
obj.iab_categories_result.nil? || AssemblyAI::Transcripts::TopicDetectionModelResult.validate_raw(obj: obj.iab_categories_result)
|
657
|
-
obj.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
|
658
699
|
obj.custom_spelling&.is_a?(Array) != false || raise("Passed value for field obj.custom_spelling is not the expected type, validation failed.")
|
659
700
|
obj.auto_chapters&.is_a?(Boolean) != false || raise("Passed value for field obj.auto_chapters is not the expected type, validation failed.")
|
660
701
|
obj.chapters&.is_a?(Array) != false || raise("Passed value for field obj.chapters is not the expected type, validation failed.")
|
@@ -664,7 +705,6 @@ module AssemblyAI
|
|
664
705
|
obj.summary&.is_a?(String) != false || raise("Passed value for field obj.summary is not the expected type, validation failed.")
|
665
706
|
obj.custom_topics&.is_a?(Boolean) != false || raise("Passed value for field obj.custom_topics is not the expected type, validation failed.")
|
666
707
|
obj.topics&.is_a?(Array) != false || raise("Passed value for field obj.topics is not the expected type, validation failed.")
|
667
|
-
obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
|
668
708
|
obj.sentiment_analysis&.is_a?(Boolean) != false || raise("Passed value for field obj.sentiment_analysis is not the expected type, validation failed.")
|
669
709
|
obj.sentiment_analysis_results&.is_a?(Array) != false || raise("Passed value for field obj.sentiment_analysis_results is not the expected type, validation failed.")
|
670
710
|
obj.entity_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.entity_detection is not the expected type, validation failed.")
|
@@ -672,6 +712,8 @@ module AssemblyAI
|
|
672
712
|
obj.speech_threshold&.is_a?(Float) != false || raise("Passed value for field obj.speech_threshold is not the expected type, validation failed.")
|
673
713
|
obj.throttled&.is_a?(Boolean) != false || raise("Passed value for field obj.throttled is not the expected type, validation failed.")
|
674
714
|
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
|
715
|
+
obj.language_model.is_a?(String) != false || raise("Passed value for field obj.language_model is not the expected type, validation failed.")
|
716
|
+
obj.acoustic_model.is_a?(String) != false || raise("Passed value for field obj.acoustic_model is not the expected type, validation failed.")
|
675
717
|
end
|
676
718
|
end
|
677
719
|
end
|
@@ -10,9 +10,9 @@ module AssemblyAI
|
|
10
10
|
# A list of transcripts. Transcripts are sorted from newest to oldest. The
|
11
11
|
# previous URL always points to a page with older transcripts.
|
12
12
|
class TranscriptList
|
13
|
-
# @return [AssemblyAI::Transcripts::PageDetails]
|
13
|
+
# @return [AssemblyAI::Transcripts::PageDetails] Details of the transcript page
|
14
14
|
attr_reader :page_details
|
15
|
-
# @return [Array<AssemblyAI::Transcripts::TranscriptListItem>]
|
15
|
+
# @return [Array<AssemblyAI::Transcripts::TranscriptListItem>] An array of transcripts
|
16
16
|
attr_reader :transcripts
|
17
17
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
18
18
|
attr_reader :additional_properties
|
@@ -22,8 +22,8 @@ module AssemblyAI
|
|
22
22
|
|
23
23
|
OMIT = Object.new
|
24
24
|
|
25
|
-
# @param page_details [AssemblyAI::Transcripts::PageDetails]
|
26
|
-
# @param transcripts [Array<AssemblyAI::Transcripts::TranscriptListItem>]
|
25
|
+
# @param page_details [AssemblyAI::Transcripts::PageDetails] Details of the transcript page
|
26
|
+
# @param transcripts [Array<AssemblyAI::Transcripts::TranscriptListItem>] An array of transcripts
|
27
27
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
28
28
|
# @return [AssemblyAI::Transcripts::TranscriptList]
|
29
29
|
def initialize(page_details:, transcripts:, additional_properties: nil)
|
@@ -8,17 +8,17 @@ require "json"
|
|
8
8
|
module AssemblyAI
|
9
9
|
class Transcripts
|
10
10
|
class TranscriptListItem
|
11
|
-
# @return [String]
|
11
|
+
# @return [String] The unique identifier for the transcript
|
12
12
|
attr_reader :id
|
13
|
-
# @return [String]
|
13
|
+
# @return [String] The URL to retrieve the transcript
|
14
14
|
attr_reader :resource_url
|
15
|
-
# @return [AssemblyAI::Transcripts::TranscriptStatus]
|
15
|
+
# @return [AssemblyAI::Transcripts::TranscriptStatus] The status of the transcript
|
16
16
|
attr_reader :status
|
17
|
-
# @return [DateTime]
|
17
|
+
# @return [DateTime] The date and time the transcript was created
|
18
18
|
attr_reader :created
|
19
|
-
# @return [DateTime]
|
19
|
+
# @return [DateTime] The date and time the transcript was completed
|
20
20
|
attr_reader :completed
|
21
|
-
# @return [String]
|
21
|
+
# @return [String] The URL to the audio file
|
22
22
|
attr_reader :audio_url
|
23
23
|
# @return [String] Error message of why the transcript failed
|
24
24
|
attr_reader :error
|
@@ -30,22 +30,22 @@ module AssemblyAI
|
|
30
30
|
|
31
31
|
OMIT = Object.new
|
32
32
|
|
33
|
-
# @param id [String]
|
34
|
-
# @param resource_url [String]
|
35
|
-
# @param status [AssemblyAI::Transcripts::TranscriptStatus]
|
36
|
-
# @param created [DateTime]
|
37
|
-
# @param completed [DateTime]
|
38
|
-
# @param audio_url [String]
|
33
|
+
# @param id [String] The unique identifier for the transcript
|
34
|
+
# @param resource_url [String] The URL to retrieve the transcript
|
35
|
+
# @param status [AssemblyAI::Transcripts::TranscriptStatus] The status of the transcript
|
36
|
+
# @param created [DateTime] The date and time the transcript was created
|
37
|
+
# @param completed [DateTime] The date and time the transcript was completed
|
38
|
+
# @param audio_url [String] The URL to the audio file
|
39
39
|
# @param error [String] Error message of why the transcript failed
|
40
40
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
41
41
|
# @return [AssemblyAI::Transcripts::TranscriptListItem]
|
42
|
-
def initialize(id:, resource_url:, status:, created:,
|
42
|
+
def initialize(id:, resource_url:, status:, created:, audio_url:, completed: OMIT, error: OMIT,
|
43
43
|
additional_properties: nil)
|
44
44
|
@id = id
|
45
45
|
@resource_url = resource_url
|
46
46
|
@status = status
|
47
47
|
@created = created
|
48
|
-
@completed = completed
|
48
|
+
@completed = completed if completed != OMIT
|
49
49
|
@audio_url = audio_url
|
50
50
|
@error = error if error != OMIT
|
51
51
|
@additional_properties = additional_properties
|
@@ -106,7 +106,7 @@ module AssemblyAI
|
|
106
106
|
obj.resource_url.is_a?(String) != false || raise("Passed value for field obj.resource_url is not the expected type, validation failed.")
|
107
107
|
obj.status.is_a?(AssemblyAI::Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
108
108
|
obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
|
109
|
-
obj.completed
|
109
|
+
obj.completed&.is_a?(DateTime) != false || raise("Passed value for field obj.completed is not the expected type, validation failed.")
|
110
110
|
obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
|
111
111
|
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
|
112
112
|
end
|