Class: AssemblyAI::Transcripts::Transcript

Inherits:
Object
  • Object
show all
Defined in:
lib/assemblyai/transcripts/types/transcript.rb

Overview

A transcript object

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, language_model:, acoustic_model:, status:, audio_url:, webhook_auth:, auto_highlights:, redact_pii:, summarization:, language_code: OMIT, text: OMIT, words: OMIT, utterances: OMIT, confidence: OMIT, audio_duration: OMIT, punctuate: OMIT, format_text: OMIT, dual_channel: OMIT, speech_model: 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, language_detection: OMIT, custom_spelling: OMIT, auto_chapters: OMIT, chapters: OMIT, summary_type: OMIT, summary_model: OMIT, summary: OMIT, custom_topics: OMIT, topics: OMIT, disfluencies: OMIT, sentiment_analysis: OMIT, sentiment_analysis_results: OMIT, entity_detection: OMIT, entities: OMIT, speech_threshold: OMIT, throttled: OMIT, error: OMIT, additional_properties: nil) ⇒ AssemblyAI::Transcripts::Transcript

Parameters:



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 327

def initialize(id:, language_model:, acoustic_model:, status:, audio_url:, webhook_auth:, auto_highlights:, redact_pii:, summarization:, language_code: OMIT, text: OMIT,
               words: OMIT, utterances: OMIT, confidence: OMIT, audio_duration: OMIT, punctuate: OMIT, format_text: OMIT, dual_channel: OMIT, speech_model: 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, language_detection: OMIT, custom_spelling: OMIT, auto_chapters: OMIT, chapters: OMIT, summary_type: OMIT, summary_model: OMIT, summary: OMIT, custom_topics: OMIT, topics: OMIT, disfluencies: OMIT, sentiment_analysis: OMIT, sentiment_analysis_results: OMIT, entity_detection: OMIT, entities: OMIT, speech_threshold: OMIT, throttled: OMIT, error: OMIT, additional_properties: nil)
  @id = id
  @language_model = language_model
  @acoustic_model = acoustic_model
  @status = status
  @language_code = language_code if language_code != OMIT
  @audio_url = audio_url
  @text = text if text != OMIT
  @words = words if words != OMIT
  @utterances = utterances if utterances != OMIT
  @confidence = confidence if confidence != OMIT
  @audio_duration = audio_duration if audio_duration != OMIT
  @punctuate = punctuate if punctuate != OMIT
  @format_text = format_text if format_text != OMIT
  @dual_channel = dual_channel if dual_channel != OMIT
  @speech_model = speech_model if speech_model != OMIT
  @webhook_url = webhook_url if webhook_url != OMIT
  @webhook_status_code = webhook_status_code if webhook_status_code != OMIT
  @webhook_auth = webhook_auth
  @webhook_auth_header_name = webhook_auth_header_name if webhook_auth_header_name != OMIT
  @speed_boost = speed_boost if speed_boost != OMIT
  @auto_highlights = auto_highlights
  @auto_highlights_result = auto_highlights_result if auto_highlights_result != OMIT
  @audio_start_from = audio_start_from if audio_start_from != OMIT
  @audio_end_at = audio_end_at if audio_end_at != OMIT
  @word_boost = word_boost if word_boost != OMIT
  @boost_param = boost_param if boost_param != OMIT
  @filter_profanity = filter_profanity if filter_profanity != OMIT
  @redact_pii = redact_pii
  @redact_pii_audio = redact_pii_audio if redact_pii_audio != OMIT
  @redact_pii_audio_quality = redact_pii_audio_quality if redact_pii_audio_quality != OMIT
  @redact_pii_policies = redact_pii_policies if redact_pii_policies != OMIT
  @redact_pii_sub = redact_pii_sub if redact_pii_sub != OMIT
  @speaker_labels = speaker_labels if speaker_labels != OMIT
  @speakers_expected = speakers_expected if speakers_expected != OMIT
  @content_safety = content_safety if content_safety != OMIT
  @content_safety_labels = content_safety_labels if content_safety_labels != OMIT
  @iab_categories = iab_categories if iab_categories != OMIT
  @iab_categories_result = iab_categories_result if iab_categories_result != OMIT
  @language_detection = language_detection if language_detection != OMIT
  @custom_spelling = custom_spelling if custom_spelling != OMIT
  @auto_chapters = auto_chapters if auto_chapters != OMIT
  @chapters = chapters if chapters != OMIT
  @summarization = summarization
  @summary_type = summary_type if summary_type != OMIT
  @summary_model = summary_model if summary_model != OMIT
  @summary = summary if summary != OMIT
  @custom_topics = custom_topics if custom_topics != OMIT
  @topics = topics if topics != OMIT
  @disfluencies = disfluencies if disfluencies != OMIT
  @sentiment_analysis = sentiment_analysis if sentiment_analysis != OMIT
  @sentiment_analysis_results = sentiment_analysis_results if sentiment_analysis_results != OMIT
  @entity_detection = entity_detection if entity_detection != OMIT
  @entities = entities if entities != OMIT
  @speech_threshold = speech_threshold if speech_threshold != OMIT
  @throttled = throttled if throttled != OMIT
  @error = error if error != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "language_model": language_model,
    "acoustic_model": acoustic_model,
    "status": status,
    "language_code": language_code,
    "audio_url": audio_url,
    "text": text,
    "words": words,
    "utterances": utterances,
    "confidence": confidence,
    "audio_duration": audio_duration,
    "punctuate": punctuate,
    "format_text": format_text,
    "dual_channel": dual_channel,
    "speech_model": speech_model,
    "webhook_url": webhook_url,
    "webhook_status_code": webhook_status_code,
    "webhook_auth": webhook_auth,
    "webhook_auth_header_name": webhook_auth_header_name,
    "speed_boost": speed_boost,
    "auto_highlights": auto_highlights,
    "auto_highlights_result": auto_highlights_result,
    "audio_start_from": audio_start_from,
    "audio_end_at": audio_end_at,
    "word_boost": word_boost,
    "boost_param": boost_param,
    "filter_profanity": filter_profanity,
    "redact_pii": redact_pii,
    "redact_pii_audio": redact_pii_audio,
    "redact_pii_audio_quality": redact_pii_audio_quality,
    "redact_pii_policies": redact_pii_policies,
    "redact_pii_sub": redact_pii_sub,
    "speaker_labels": speaker_labels,
    "speakers_expected": speakers_expected,
    "content_safety": content_safety,
    "content_safety_labels": content_safety_labels,
    "iab_categories": iab_categories,
    "iab_categories_result": iab_categories_result,
    "language_detection": language_detection,
    "custom_spelling": custom_spelling,
    "auto_chapters": auto_chapters,
    "chapters": chapters,
    "summarization": summarization,
    "summary_type": summary_type,
    "summary_model": summary_model,
    "summary": summary,
    "custom_topics": custom_topics,
    "topics": topics,
    "disfluencies": disfluencies,
    "sentiment_analysis": sentiment_analysis,
    "sentiment_analysis_results": sentiment_analysis_results,
    "entity_detection": entity_detection,
    "entities": entities,
    "speech_threshold": speech_threshold,
    "throttled": throttled,
    "error": error
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#acoustic_modelString (readonly)

Returns The acoustic model that was used for the transcript.

Returns:

  • (String)

    The acoustic model that was used for the transcript



30
31
32
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 30

def acoustic_model
  @acoustic_model
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



200
201
202
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 200

def additional_properties
  @additional_properties
end

#audio_durationInteger (readonly)

Returns The duration of this transcript object’s media file, in seconds.

Returns:

  • (Integer)

    The duration of this transcript object’s media file, in seconds



59
60
61
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 59

def audio_duration
  @audio_duration
end

#audio_end_atInteger (readonly)

Returns The point in time, in milliseconds, in the file at which the transcription was terminated.

Returns:

  • (Integer)

    The point in time, in milliseconds, in the file at which the transcription was terminated



94
95
96
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 94

def audio_end_at
  @audio_end_at
end

#audio_start_fromInteger (readonly)

Returns The point in time, in milliseconds, in the file at which the transcription was started.

Returns:

  • (Integer)

    The point in time, in milliseconds, in the file at which the transcription was started



91
92
93
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 91

def audio_start_from
  @audio_start_from
end

#audio_urlString (readonly)

Returns The URL of the media that was transcribed.

Returns:

  • (String)

    The URL of the media that was transcribed



40
41
42
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 40

def audio_url
  @audio_url
end

#auto_chaptersBoolean (readonly)

Returns Whether [Auto Chapters](www.assemblyai.com/docs/models/auto-chapters) is enabled, can be true or false.

Returns:



151
152
153
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 151

def auto_chapters
  @auto_chapters
end

#auto_highlightsBoolean (readonly)

Returns Whether Key Phrases is enabled, either true or false.

Returns:

  • (Boolean)

    Whether Key Phrases is enabled, either true or false



86
87
88
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 86

def auto_highlights
  @auto_highlights
end

#auto_highlights_resultAssemblyAI::Transcripts::AutoHighlightsResult (readonly)



88
89
90
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 88

def auto_highlights_result
  @auto_highlights_result
end

#boost_paramString (readonly)

Returns The word boost parameter value.

Returns:

  • (String)

    The word boost parameter value



98
99
100
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 98

def boost_param
  @boost_param
end

#chaptersArray<AssemblyAI::Transcripts::Chapter> (readonly)

Returns An array of temporally sequential chapters for the audio file.

Returns:



153
154
155
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 153

def chapters
  @chapters
end

#confidenceFloat (readonly)

Returns The confidence score for the transcript, between 0.0 (low confidence) and 1.0 (high confidence).

Returns:

  • (Float)

    The confidence score for the transcript, between 0.0 (low confidence) and 1.0 (high confidence)



57
58
59
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 57

def confidence
  @confidence
end

#content_safetyBoolean (readonly)

Returns Whether [Content Moderation](www.assemblyai.com/docs/models/content-moderation) is enabled, can be true or false.

Returns:



134
135
136
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 134

def content_safety
  @content_safety
end

#content_safety_labelsAssemblyAI::Transcripts::ContentSafetyLabelsResult (readonly)



136
137
138
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 136

def content_safety_labels
  @content_safety_labels
end

#custom_spellingArray<AssemblyAI::Transcripts::TranscriptCustomSpelling> (readonly)

Returns Customize how words are spelled and formatted using to and from values.

Returns:



148
149
150
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 148

def custom_spelling
  @custom_spelling
end

#custom_topicsBoolean (readonly)

Returns Whether custom topics is enabled, either true or false.

Returns:

  • (Boolean)

    Whether custom topics is enabled, either true or false



168
169
170
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 168

def custom_topics
  @custom_topics
end

#disfluenciesBoolean (readonly)

Returns Transcribe Filler Words, like “umm”, in your media file; can be true or false.

Returns:

  • (Boolean)

    Transcribe Filler Words, like “umm”, in your media file; can be true or false



172
173
174
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 172

def disfluencies
  @disfluencies
end

#dual_channelBoolean (readonly)

Returns Whether [Dual channel ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) was enabled in the transcription request, either true or false.

Returns:



67
68
69
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 67

def dual_channel
  @dual_channel
end

#entitiesArray<AssemblyAI::Transcripts::Entity> (readonly)

Returns An array of results for the Entity Detection model, if it is enabled. See [Entity detection](www.assemblyai.com/docs/models/entity-detection) for more information.

Returns:



189
190
191
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 189

def entities
  @entities
end

#entity_detectionBoolean (readonly)

Returns Whether [Entity Detection](www.assemblyai.com/docs/models/entity-detection) is enabled, can be true or false.

Returns:



185
186
187
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 185

def entity_detection
  @entity_detection
end

#errorString (readonly)

Returns Error message of why the transcript failed.

Returns:

  • (String)

    Error message of why the transcript failed



198
199
200
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 198

def error
  @error
end

#filter_profanityBoolean (readonly)

Returns Whether [Profanity ](www.assemblyai.com/docs/models/speech-recognition#profanity-filtering) is enabled, either true or false.

Returns:



102
103
104
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 102

def filter_profanity
  @filter_profanity
end

#format_textBoolean (readonly)

Returns Whether Text Formatting is enabled, either true or false.

Returns:

  • (Boolean)

    Whether Text Formatting is enabled, either true or false



63
64
65
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 63

def format_text
  @format_text
end

#iab_categoriesBoolean (readonly)

Returns Whether [Topic Detection](www.assemblyai.com/docs/models/topic-detection) is enabled, can be true or false.

Returns:



140
141
142
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 140

def iab_categories
  @iab_categories
end

#iab_categories_resultAssemblyAI::Transcripts::TopicDetectionModelResult (readonly)



142
143
144
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 142

def iab_categories_result
  @iab_categories_result
end

#idString (readonly)

Returns The unique identifier of your transcript.

Returns:

  • (String)

    The unique identifier of your transcript



26
27
28
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 26

def id
  @id
end

#language_codeAssemblyAI::Transcripts::TranscriptLanguageCode (readonly)

Returns The language of your audio file. Possible values are found in [Supported Languages](www.assemblyai.com/docs/concepts/supported-languages). The default value is ‘en_us’.

Returns:



38
39
40
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 38

def language_code
  @language_code
end

#language_detectionBoolean (readonly)

Returns Whether [Automatic language /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection) is enabled, either true or false.

Returns:



146
147
148
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 146

def language_detection
  @language_detection
end

#language_modelString (readonly)

Returns The language model that was used for the transcript.

Returns:

  • (String)

    The language model that was used for the transcript



28
29
30
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 28

def language_model
  @language_model
end

#punctuateBoolean (readonly)

Returns Whether Automatic Punctuation is enabled, either true or false.

Returns:

  • (Boolean)

    Whether Automatic Punctuation is enabled, either true or false



61
62
63
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 61

def punctuate
  @punctuate
end

#redact_piiBoolean (readonly)

Returns Whether [PII Redaction](www.assemblyai.com/docs/models/pii-redaction) is enabled, either true or false.

Returns:



105
106
107
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 105

def redact_pii
  @redact_pii
end

#redact_pii_audioBoolean (readonly)

Returns Whether a redacted version of the audio file was generated, either true or false. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more information.

Returns:



110
111
112
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 110

def redact_pii_audio
  @redact_pii_audio
end

#redact_pii_audio_qualityAssemblyAI::Transcripts::RedactPiiAudioQuality (readonly)



112
113
114
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 112

def redact_pii_audio_quality
  @redact_pii_audio_quality
end

#redact_pii_policiesArray<AssemblyAI::Transcripts::PiiPolicy> (readonly)

Returns The list of PII Redaction policies that were enabled, if PII Redaction is enabled. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more information.

Returns:



117
118
119
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 117

def redact_pii_policies
  @redact_pii_policies
end

#redact_pii_subAssemblyAI::Transcripts::SubstitutionPolicy (readonly)

Returns The replacement logic for detected PII, can be “entity_type” or “hash”. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more details.

Returns:



121
122
123
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 121

def redact_pii_sub
  @redact_pii_sub
end

#sentiment_analysisBoolean (readonly)

Returns Whether [Sentiment Analysis](www.assemblyai.com/docs/models/sentiment-analysis) is enabled, can be true or false.

Returns:



176
177
178
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 176

def sentiment_analysis
  @sentiment_analysis
end

#sentiment_analysis_resultsArray<AssemblyAI::Transcripts::SentimentAnalysisResult> (readonly)

Returns An array of results for the Sentiment Analysis model, if it is enabled. See [Sentiment Analysis](www.assemblyai.com/docs/models/sentiment-analysis) for more information.

Returns:



181
182
183
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 181

def sentiment_analysis_results
  @sentiment_analysis_results
end

#speaker_labelsBoolean (readonly)

Returns Whether [Speaker diarization](www.assemblyai.com/docs/models/speaker-diarization) is enabled, can be true or false.

Returns:



125
126
127
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 125

def speaker_labels
  @speaker_labels
end

#speakers_expectedInteger (readonly)

Returns Tell the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](www.assemblyai.com/docs/models/speaker-diarization) for more details.

Returns:



130
131
132
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 130

def speakers_expected
  @speakers_expected
end

#speech_modelAssemblyAI::Transcripts::SpeechModel (readonly)



69
70
71
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 69

def speech_model
  @speech_model
end

#speech_thresholdFloat (readonly)

Returns Defaults to null. Reject audio files that contain less than this fraction of speech. Valid values are in the range [0, 1] inclusive.

Returns:

  • (Float)

    Defaults to null. Reject audio files that contain less than this fraction of speech. Valid values are in the range [0, 1] inclusive.



193
194
195
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 193

def speech_threshold
  @speech_threshold
end

#speed_boostBoolean (readonly)

Returns Whether speed boost is enabled.

Returns:

  • (Boolean)

    Whether speed boost is enabled



84
85
86
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 84

def speed_boost
  @speed_boost
end

#statusAssemblyAI::Transcripts::TranscriptStatus (readonly)

Returns The status of your transcript. Possible values are queued, processing, completed, or error.

Returns:



33
34
35
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 33

def status
  @status
end

#summarizationBoolean (readonly)

Returns Whether [Summarization](www.assemblyai.com/docs/models/summarization) is enabled, either true or false.

Returns:



156
157
158
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 156

def summarization
  @summarization
end

#summaryString (readonly)

Returns The generated summary of the media file, if [Summarization](www.assemblyai.com/docs/models/summarization) is enabled.

Returns:



166
167
168
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 166

def summary
  @summary
end

#summary_modelString (readonly)

Returns The Summarization model used to generate the summary, if [Summarization](www.assemblyai.com/docs/models/summarization) is enabled.

Returns:



163
164
165
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 163

def summary_model
  @summary_model
end

#summary_typeString (readonly)

Returns The type of summary generated, if [Summarization](www.assemblyai.com/docs/models/summarization) is enabled.

Returns:



159
160
161
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 159

def summary_type
  @summary_type
end

#textString (readonly)

Returns The textual transcript of your media file.

Returns:

  • (String)

    The textual transcript of your media file



42
43
44
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 42

def text
  @text
end

#throttledBoolean (readonly)

Returns True while a request is throttled and false when a request is no longer throttled.

Returns:

  • (Boolean)

    True while a request is throttled and false when a request is no longer throttled



196
197
198
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 196

def throttled
  @throttled
end

#topicsArray<String> (readonly)

Returns The list of custom topics provided if custom topics is enabled.

Returns:

  • (Array<String>)

    The list of custom topics provided if custom topics is enabled



170
171
172
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 170

def topics
  @topics
end

#utterancesArray<AssemblyAI::Transcripts::TranscriptUtterance> (readonly)

Returns When dual_channel or speaker_labels is enabled, a list of turn-by-turn utterance objects. See [Speaker diarization](www.assemblyai.com/docs/models/speaker-diarization) for more information.

Returns:



54
55
56
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 54

def utterances
  @utterances
end

#webhook_authBoolean (readonly)

Returns Whether webhook authentication details were provided.

Returns:

  • (Boolean)

    Whether webhook authentication details were provided



79
80
81
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 79

def webhook_auth
  @webhook_auth
end

#webhook_auth_header_nameString (readonly)

Returns The header name to be sent with the transcript completed or failed webhook requests.

Returns:

  • (String)

    The header name to be sent with the transcript completed or failed webhook requests



82
83
84
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 82

def webhook_auth_header_name
  @webhook_auth_header_name
end

#webhook_status_codeInteger (readonly)

Returns The status code we received from your server when delivering the transcript completed or failed webhook request, if a webhook URL was provided.

Returns:

  • (Integer)

    The status code we received from your server when delivering the transcript completed or failed webhook request, if a webhook URL was provided



77
78
79
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 77

def webhook_status_code
  @webhook_status_code
end

#webhook_urlString (readonly)

Returns The URL to which we send webhook requests. We sends two different types of webhook requests. One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.

Returns:

  • (String)

    The URL to which we send webhook requests. We sends two different types of webhook requests. One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.



74
75
76
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 74

def webhook_url
  @webhook_url
end

#word_boostArray<String> (readonly)

Returns The list of custom vocabulary to boost transcription probability for.

Returns:

  • (Array<String>)

    The list of custom vocabulary to boost transcription probability for



96
97
98
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 96

def word_boost
  @word_boost
end

#wordsArray<AssemblyAI::Transcripts::TranscriptWord> (readonly)

Returns An array of temporally-sequential word objects, one for each word in the transcript. See [Speech recognition](www.assemblyai.com/docs/models/speech-recognition) for more information.

Returns:



48
49
50
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 48

def words
  @words
end

Class Method Details

.from_json(json_object:) ⇒ AssemblyAI::Transcripts::Transcript

Deserialize a JSON object to an instance of Transcript

Parameters:

  • json_object (String)

Returns:



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 452

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = struct["id"]
  language_model = struct["language_model"]
  acoustic_model = struct["acoustic_model"]
  status = struct["status"]
  language_code = struct["language_code"]
  audio_url = struct["audio_url"]
  text = struct["text"]
  words = parsed_json["words"]&.map do |v|
    v = v.to_json
    AssemblyAI::Transcripts::TranscriptWord.from_json(json_object: v)
  end
  utterances = parsed_json["utterances"]&.map do |v|
    v = v.to_json
    AssemblyAI::Transcripts::TranscriptUtterance.from_json(json_object: v)
  end
  confidence = struct["confidence"]
  audio_duration = struct["audio_duration"]
  punctuate = struct["punctuate"]
  format_text = struct["format_text"]
  dual_channel = struct["dual_channel"]
  speech_model = struct["speech_model"]
  webhook_url = struct["webhook_url"]
  webhook_status_code = struct["webhook_status_code"]
  webhook_auth = struct["webhook_auth"]
  webhook_auth_header_name = struct["webhook_auth_header_name"]
  speed_boost = struct["speed_boost"]
  auto_highlights = struct["auto_highlights"]
  if parsed_json["auto_highlights_result"].nil?
    auto_highlights_result = nil
  else
    auto_highlights_result = parsed_json["auto_highlights_result"].to_json
    auto_highlights_result = AssemblyAI::Transcripts::AutoHighlightsResult.from_json(json_object: auto_highlights_result)
  end
  audio_start_from = struct["audio_start_from"]
  audio_end_at = struct["audio_end_at"]
  word_boost = struct["word_boost"]
  boost_param = struct["boost_param"]
  filter_profanity = struct["filter_profanity"]
  redact_pii = struct["redact_pii"]
  redact_pii_audio = struct["redact_pii_audio"]
  redact_pii_audio_quality = struct["redact_pii_audio_quality"]
  redact_pii_policies = struct["redact_pii_policies"]
  redact_pii_sub = struct["redact_pii_sub"]
  speaker_labels = struct["speaker_labels"]
  speakers_expected = struct["speakers_expected"]
  content_safety = struct["content_safety"]
  if parsed_json["content_safety_labels"].nil?
    content_safety_labels = nil
  else
    content_safety_labels = parsed_json["content_safety_labels"].to_json
    content_safety_labels = AssemblyAI::Transcripts::ContentSafetyLabelsResult.from_json(json_object: content_safety_labels)
  end
  iab_categories = struct["iab_categories"]
  if parsed_json["iab_categories_result"].nil?
    iab_categories_result = nil
  else
    iab_categories_result = parsed_json["iab_categories_result"].to_json
    iab_categories_result = AssemblyAI::Transcripts::TopicDetectionModelResult.from_json(json_object: iab_categories_result)
  end
  language_detection = struct["language_detection"]
  custom_spelling = parsed_json["custom_spelling"]&.map do |v|
    v = v.to_json
    AssemblyAI::Transcripts::TranscriptCustomSpelling.from_json(json_object: v)
  end
  auto_chapters = struct["auto_chapters"]
  chapters = parsed_json["chapters"]&.map do |v|
    v = v.to_json
    AssemblyAI::Transcripts::Chapter.from_json(json_object: v)
  end
  summarization = struct["summarization"]
  summary_type = struct["summary_type"]
  summary_model = struct["summary_model"]
  summary = struct["summary"]
  custom_topics = struct["custom_topics"]
  topics = struct["topics"]
  disfluencies = struct["disfluencies"]
  sentiment_analysis = struct["sentiment_analysis"]
  sentiment_analysis_results = parsed_json["sentiment_analysis_results"]&.map do |v|
    v = v.to_json
    AssemblyAI::Transcripts::SentimentAnalysisResult.from_json(json_object: v)
  end
  entity_detection = struct["entity_detection"]
  entities = parsed_json["entities"]&.map do |v|
    v = v.to_json
    AssemblyAI::Transcripts::Entity.from_json(json_object: v)
  end
  speech_threshold = struct["speech_threshold"]
  throttled = struct["throttled"]
  error = struct["error"]
  new(
    id: id,
    language_model: language_model,
    acoustic_model: acoustic_model,
    status: status,
    language_code: language_code,
    audio_url: audio_url,
    text: text,
    words: words,
    utterances: utterances,
    confidence: confidence,
    audio_duration: audio_duration,
    punctuate: punctuate,
    format_text: format_text,
    dual_channel: dual_channel,
    speech_model: speech_model,
    webhook_url: webhook_url,
    webhook_status_code: webhook_status_code,
    webhook_auth: webhook_auth,
    webhook_auth_header_name: webhook_auth_header_name,
    speed_boost: speed_boost,
    auto_highlights: auto_highlights,
    auto_highlights_result: auto_highlights_result,
    audio_start_from: audio_start_from,
    audio_end_at: audio_end_at,
    word_boost: word_boost,
    boost_param: boost_param,
    filter_profanity: filter_profanity,
    redact_pii: redact_pii,
    redact_pii_audio: redact_pii_audio,
    redact_pii_audio_quality: redact_pii_audio_quality,
    redact_pii_policies: redact_pii_policies,
    redact_pii_sub: redact_pii_sub,
    speaker_labels: speaker_labels,
    speakers_expected: speakers_expected,
    content_safety: content_safety,
    content_safety_labels: content_safety_labels,
    iab_categories: iab_categories,
    iab_categories_result: iab_categories_result,
    language_detection: language_detection,
    custom_spelling: custom_spelling,
    auto_chapters: auto_chapters,
    chapters: chapters,
    summarization: summarization,
    summary_type: summary_type,
    summary_model: summary_model,
    summary: summary,
    custom_topics: custom_topics,
    topics: topics,
    disfluencies: disfluencies,
    sentiment_analysis: sentiment_analysis,
    sentiment_analysis_results: sentiment_analysis_results,
    entity_detection: entity_detection,
    entities: entities,
    speech_threshold: speech_threshold,
    throttled: throttled,
    error: error,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 618

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.language_model.is_a?(String) != false || raise("Passed value for field obj.language_model is not the expected type, validation failed.")
  obj.acoustic_model.is_a?(String) != false || raise("Passed value for field obj.acoustic_model is not the expected type, validation failed.")
  obj.status.is_a?(AssemblyAI::Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.language_code&.is_a?(AssemblyAI::Transcripts::TranscriptLanguageCode) != false || raise("Passed value for field obj.language_code is not the expected type, validation failed.")
  obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
  obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
  obj.words&.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
  obj.utterances&.is_a?(Array) != false || raise("Passed value for field obj.utterances is not the expected type, validation failed.")
  obj.confidence&.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
  obj.audio_duration&.is_a?(Integer) != false || raise("Passed value for field obj.audio_duration is not the expected type, validation failed.")
  obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.")
  obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.")
  obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.")
  obj.speech_model&.is_a?(AssemblyAI::Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
  obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.")
  obj.webhook_status_code&.is_a?(Integer) != false || raise("Passed value for field obj.webhook_status_code is not the expected type, validation failed.")
  obj.webhook_auth.is_a?(Boolean) != false || raise("Passed value for field obj.webhook_auth is not the expected type, validation failed.")
  obj.webhook_auth_header_name&.is_a?(String) != false || raise("Passed value for field obj.webhook_auth_header_name is not the expected type, validation failed.")
  obj.speed_boost&.is_a?(Boolean) != false || raise("Passed value for field obj.speed_boost is not the expected type, validation failed.")
  obj.auto_highlights.is_a?(Boolean) != false || raise("Passed value for field obj.auto_highlights is not the expected type, validation failed.")
  obj.auto_highlights_result.nil? || AssemblyAI::Transcripts::AutoHighlightsResult.validate_raw(obj: obj.auto_highlights_result)
  obj.audio_start_from&.is_a?(Integer) != false || raise("Passed value for field obj.audio_start_from is not the expected type, validation failed.")
  obj.audio_end_at&.is_a?(Integer) != false || raise("Passed value for field obj.audio_end_at is not the expected type, validation failed.")
  obj.word_boost&.is_a?(Array) != false || raise("Passed value for field obj.word_boost is not the expected type, validation failed.")
  obj.boost_param&.is_a?(String) != false || raise("Passed value for field obj.boost_param is not the expected type, validation failed.")
  obj.filter_profanity&.is_a?(Boolean) != false || raise("Passed value for field obj.filter_profanity is not the expected type, validation failed.")
  obj.redact_pii.is_a?(Boolean) != false || raise("Passed value for field obj.redact_pii is not the expected type, validation failed.")
  obj.redact_pii_audio&.is_a?(Boolean) != false || raise("Passed value for field obj.redact_pii_audio is not the expected type, validation failed.")
  obj.redact_pii_audio_quality&.is_a?(AssemblyAI::Transcripts::RedactPiiAudioQuality) != false || raise("Passed value for field obj.redact_pii_audio_quality is not the expected type, validation failed.")
  obj.redact_pii_policies&.is_a?(Array) != false || raise("Passed value for field obj.redact_pii_policies is not the expected type, validation failed.")
  obj.redact_pii_sub&.is_a?(AssemblyAI::Transcripts::SubstitutionPolicy) != false || raise("Passed value for field obj.redact_pii_sub is not the expected type, validation failed.")
  obj.speaker_labels&.is_a?(Boolean) != false || raise("Passed value for field obj.speaker_labels is not the expected type, validation failed.")
  obj.speakers_expected&.is_a?(Integer) != false || raise("Passed value for field obj.speakers_expected is not the expected type, validation failed.")
  obj.content_safety&.is_a?(Boolean) != false || raise("Passed value for field obj.content_safety is not the expected type, validation failed.")
  obj.content_safety_labels.nil? || AssemblyAI::Transcripts::ContentSafetyLabelsResult.validate_raw(obj: obj.content_safety_labels)
  obj.iab_categories&.is_a?(Boolean) != false || raise("Passed value for field obj.iab_categories is not the expected type, validation failed.")
  obj.iab_categories_result.nil? || AssemblyAI::Transcripts::TopicDetectionModelResult.validate_raw(obj: obj.iab_categories_result)
  obj.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
  obj.custom_spelling&.is_a?(Array) != false || raise("Passed value for field obj.custom_spelling is not the expected type, validation failed.")
  obj.auto_chapters&.is_a?(Boolean) != false || raise("Passed value for field obj.auto_chapters is not the expected type, validation failed.")
  obj.chapters&.is_a?(Array) != false || raise("Passed value for field obj.chapters is not the expected type, validation failed.")
  obj.summarization.is_a?(Boolean) != false || raise("Passed value for field obj.summarization is not the expected type, validation failed.")
  obj.summary_type&.is_a?(String) != false || raise("Passed value for field obj.summary_type is not the expected type, validation failed.")
  obj.summary_model&.is_a?(String) != false || raise("Passed value for field obj.summary_model is not the expected type, validation failed.")
  obj.summary&.is_a?(String) != false || raise("Passed value for field obj.summary is not the expected type, validation failed.")
  obj.custom_topics&.is_a?(Boolean) != false || raise("Passed value for field obj.custom_topics is not the expected type, validation failed.")
  obj.topics&.is_a?(Array) != false || raise("Passed value for field obj.topics is not the expected type, validation failed.")
  obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
  obj.sentiment_analysis&.is_a?(Boolean) != false || raise("Passed value for field obj.sentiment_analysis is not the expected type, validation failed.")
  obj.sentiment_analysis_results&.is_a?(Array) != false || raise("Passed value for field obj.sentiment_analysis_results is not the expected type, validation failed.")
  obj.entity_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.entity_detection is not the expected type, validation failed.")
  obj.entities&.is_a?(Array) != false || raise("Passed value for field obj.entities is not the expected type, validation failed.")
  obj.speech_threshold&.is_a?(Float) != false || raise("Passed value for field obj.speech_threshold is not the expected type, validation failed.")
  obj.throttled&.is_a?(Boolean) != false || raise("Passed value for field obj.throttled is not the expected type, validation failed.")
  obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Transcript to a JSON object

Returns:

  • (String)


608
609
610
# File 'lib/assemblyai/transcripts/types/transcript.rb', line 608

def to_json(*_args)
  @_field_set&.to_json
end