Class: AssemblyAI::Transcripts::TranscriptOptionalParams

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

Overview

The parameters for creating a transcript

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language_code: OMIT, punctuate: OMIT, format_text: OMIT, dual_channel: OMIT, speech_model: OMIT, webhook_url: OMIT, webhook_auth_header_name: OMIT, webhook_auth_header_value: OMIT, auto_highlights: OMIT, audio_start_from: OMIT, audio_end_at: OMIT, word_boost: OMIT, boost_param: OMIT, filter_profanity: OMIT, redact_pii: 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_confidence: OMIT, iab_categories: OMIT, language_detection: OMIT, custom_spelling: OMIT, disfluencies: OMIT, sentiment_analysis: OMIT, auto_chapters: OMIT, entity_detection: OMIT, speech_threshold: OMIT, summarization: OMIT, summary_model: OMIT, summary_type: OMIT, custom_topics: OMIT, topics: OMIT, additional_properties: nil) ⇒ AssemblyAI::Transcripts::TranscriptOptionalParams

Parameters:

  • language_code (AssemblyAI::Transcripts::TranscriptLanguageCode) (defaults to: OMIT)
  • punctuate (Boolean) (defaults to: OMIT)

    Enable Automatic Punctuation, can be true or false

  • format_text (Boolean) (defaults to: OMIT)

    Enable Text Formatting, can be true or false

  • dual_channel (Boolean) (defaults to: OMIT)

    Enable [Dual ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.

  • speech_model (AssemblyAI::Transcripts::SpeechModel) (defaults to: OMIT)
  • webhook_url (String) (defaults to: OMIT)

    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.

  • webhook_auth_header_name (String) (defaults to: OMIT)

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

  • webhook_auth_header_value (String) (defaults to: OMIT)

    The header value to send back with the transcript completed or failed webhook requests for added security

  • auto_highlights (Boolean) (defaults to: OMIT)

    Enable Key Phrases, either true or false

  • audio_start_from (Integer) (defaults to: OMIT)

    The point in time, in milliseconds, to begin transcribing in your media file

  • audio_end_at (Integer) (defaults to: OMIT)

    The point in time, in milliseconds, to stop transcribing in your media file

  • word_boost (Array<String>) (defaults to: OMIT)

    The list of custom vocabulary to boost transcription probability for

  • boost_param (AssemblyAI::Transcripts::TranscriptBoostParam) (defaults to: OMIT)

    The word boost parameter value

  • filter_profanity (Boolean) (defaults to: OMIT)

    Filter profanity from the transcribed text, can be true or false

  • redact_pii (Boolean) (defaults to: OMIT)

    Redact PII from the transcribed text using the Redact PII model, can be true or false

  • redact_pii_audio (Boolean) (defaults to: OMIT)

    Generate a copy of the original media file with spoken PII “beeped” out, can be true or false. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more details.

  • redact_pii_audio_quality (AssemblyAI::Transcripts::RedactPiiAudioQuality) (defaults to: OMIT)

    Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more details.

  • redact_pii_policies (Array<AssemblyAI::Transcripts::PiiPolicy>) (defaults to: OMIT)

    The list of PII Redaction policies to enable. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more details.

  • redact_pii_sub (AssemblyAI::Transcripts::SubstitutionPolicy) (defaults to: OMIT)
  • speaker_labels (Boolean) (defaults to: OMIT)

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

  • speakers_expected (Integer) (defaults to: OMIT)

    Tells 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.

  • content_safety (Boolean) (defaults to: OMIT)

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

  • content_safety_confidence (Integer) (defaults to: OMIT)

    The confidence threshold for the Content Moderation model. Values must be between 25 and 100.

  • iab_categories (Boolean) (defaults to: OMIT)

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

  • language_detection (Boolean) (defaults to: OMIT)

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

  • custom_spelling (Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>) (defaults to: OMIT)

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

  • disfluencies (Boolean) (defaults to: OMIT)

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

  • sentiment_analysis (Boolean) (defaults to: OMIT)

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

  • auto_chapters (Boolean) (defaults to: OMIT)

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

  • entity_detection (Boolean) (defaults to: OMIT)

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

  • speech_threshold (Float) (defaults to: OMIT)

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

  • summarization (Boolean) (defaults to: OMIT)

    Enable [Summarization](www.assemblyai.com/docs/models/summarization), can be true or false

  • summary_model (AssemblyAI::Transcripts::SummaryModel) (defaults to: OMIT)

    The model to summarize the transcript

  • summary_type (AssemblyAI::Transcripts::SummaryType) (defaults to: OMIT)

    The type of summary

  • custom_topics (Boolean) (defaults to: OMIT)

    Enable custom topics, either true or false

  • topics (Array<String>) (defaults to: OMIT)

    The list of custom topics

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 205

def initialize(language_code: OMIT, punctuate: OMIT, format_text: OMIT, dual_channel: OMIT, speech_model: OMIT,
               webhook_url: OMIT, webhook_auth_header_name: OMIT, webhook_auth_header_value: OMIT, auto_highlights: OMIT, audio_start_from: OMIT, audio_end_at: OMIT, word_boost: OMIT, boost_param: OMIT, filter_profanity: OMIT, redact_pii: 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_confidence: OMIT, iab_categories: OMIT, language_detection: OMIT, custom_spelling: OMIT, disfluencies: OMIT, sentiment_analysis: OMIT, auto_chapters: OMIT, entity_detection: OMIT, speech_threshold: OMIT, summarization: OMIT, summary_model: OMIT, summary_type: OMIT, custom_topics: OMIT, topics: OMIT, additional_properties: nil)
  @language_code = language_code if language_code != 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_auth_header_name = webhook_auth_header_name if webhook_auth_header_name != OMIT
  @webhook_auth_header_value = webhook_auth_header_value if webhook_auth_header_value != OMIT
  @auto_highlights = auto_highlights if auto_highlights != 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 if redact_pii != OMIT
  @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_confidence = content_safety_confidence if content_safety_confidence != OMIT
  @iab_categories = iab_categories if iab_categories != OMIT
  @language_detection = language_detection if language_detection != OMIT
  @custom_spelling = custom_spelling if custom_spelling != OMIT
  @disfluencies = disfluencies if disfluencies != OMIT
  @sentiment_analysis = sentiment_analysis if sentiment_analysis != OMIT
  @auto_chapters = auto_chapters if auto_chapters != OMIT
  @entity_detection = entity_detection if entity_detection != OMIT
  @speech_threshold = speech_threshold if speech_threshold != OMIT
  @summarization = summarization if summarization != OMIT
  @summary_model = summary_model if summary_model != OMIT
  @summary_type = summary_type if summary_type != OMIT
  @custom_topics = custom_topics if custom_topics != OMIT
  @topics = topics if topics != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "language_code": language_code,
    "punctuate": punctuate,
    "format_text": format_text,
    "dual_channel": dual_channel,
    "speech_model": speech_model,
    "webhook_url": webhook_url,
    "webhook_auth_header_name": webhook_auth_header_name,
    "webhook_auth_header_value": webhook_auth_header_value,
    "auto_highlights": auto_highlights,
    "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_confidence": content_safety_confidence,
    "iab_categories": iab_categories,
    "language_detection": language_detection,
    "custom_spelling": custom_spelling,
    "disfluencies": disfluencies,
    "sentiment_analysis": sentiment_analysis,
    "auto_chapters": auto_chapters,
    "entity_detection": entity_detection,
    "speech_threshold": speech_threshold,
    "summarization": summarization,
    "summary_model": summary_model,
    "summary_type": summary_type,
    "custom_topics": custom_topics,
    "topics": topics
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



126
127
128
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 126

def additional_properties
  @additional_properties
end

#audio_end_atInteger (readonly)

Returns The point in time, in milliseconds, to stop transcribing in your media file.

Returns:

  • (Integer)

    The point in time, in milliseconds, to stop transcribing in your media file



46
47
48
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 46

def audio_end_at
  @audio_end_at
end

#audio_start_fromInteger (readonly)

Returns The point in time, in milliseconds, to begin transcribing in your media file.

Returns:

  • (Integer)

    The point in time, in milliseconds, to begin transcribing in your media file



44
45
46
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 44

def audio_start_from
  @audio_start_from
end

#auto_chaptersBoolean (readonly)

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

Returns:



106
107
108
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 106

def auto_chapters
  @auto_chapters
end

#auto_highlightsBoolean (readonly)

Returns Enable Key Phrases, either true or false.

Returns:

  • (Boolean)

    Enable Key Phrases, either true or false



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

def auto_highlights
  @auto_highlights
end

#boost_paramAssemblyAI::Transcripts::TranscriptBoostParam (readonly)

Returns The word boost parameter value.

Returns:



50
51
52
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 50

def boost_param
  @boost_param
end

#content_safetyBoolean (readonly)

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

Returns:



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

def content_safety
  @content_safety
end

#content_safety_confidenceInteger (readonly)

Returns The confidence threshold for the Content Moderation model. Values must be between 25 and 100.

Returns:

  • (Integer)

    The confidence threshold for the Content Moderation model. Values must be between 25 and 100.



87
88
89
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 87

def content_safety_confidence
  @content_safety_confidence
end

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

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

Returns:



97
98
99
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 97

def custom_spelling
  @custom_spelling
end

#custom_topicsBoolean (readonly)

Returns Enable custom topics, either true or false.

Returns:

  • (Boolean)

    Enable custom topics, either true or false



122
123
124
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 122

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



99
100
101
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 99

def disfluencies
  @disfluencies
end

#dual_channelBoolean (readonly)

Returns Enable [Dual ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.

Returns:



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

def dual_channel
  @dual_channel
end

#entity_detectionBoolean (readonly)

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

Returns:



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

def entity_detection
  @entity_detection
end

#filter_profanityBoolean (readonly)

Returns Filter profanity from the transcribed text, can be true or false.

Returns:

  • (Boolean)

    Filter profanity from the transcribed text, can be true or false



52
53
54
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 52

def filter_profanity
  @filter_profanity
end

#format_textBoolean (readonly)

Returns Enable Text Formatting, can be true or false.

Returns:

  • (Boolean)

    Enable Text Formatting, can be true or false



24
25
26
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 24

def format_text
  @format_text
end

#iab_categoriesBoolean (readonly)

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

Returns:



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

def iab_categories
  @iab_categories
end

#language_codeAssemblyAI::Transcripts::TranscriptLanguageCode (readonly)



20
21
22
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 20

def language_code
  @language_code
end

#language_detectionBoolean (readonly)

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

Returns:



95
96
97
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 95

def language_detection
  @language_detection
end

#punctuateBoolean (readonly)

Returns Enable Automatic Punctuation, can be true or false.

Returns:

  • (Boolean)

    Enable Automatic Punctuation, can be true or false



22
23
24
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 22

def punctuate
  @punctuate
end

#redact_piiBoolean (readonly)

Returns Redact PII from the transcribed text using the Redact PII model, can be true or false.

Returns:

  • (Boolean)

    Redact PII from the transcribed text using the Redact PII model, can be true or false



55
56
57
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 55

def redact_pii
  @redact_pii
end

#redact_pii_audioBoolean (readonly)

Returns Generate a copy of the original media file with spoken PII “beeped” out, can be true or false. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more details.

Returns:



60
61
62
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 60

def redact_pii_audio
  @redact_pii_audio
end

#redact_pii_audio_qualityAssemblyAI::Transcripts::RedactPiiAudioQuality (readonly)

Returns Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more details.

Returns:



65
66
67
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 65

def redact_pii_audio_quality
  @redact_pii_audio_quality
end

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

Returns The list of PII Redaction policies to enable. See [PII redaction](www.assemblyai.com/docs/models/pii-redaction) for more details.

Returns:



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

def redact_pii_policies
  @redact_pii_policies
end

#redact_pii_subAssemblyAI::Transcripts::SubstitutionPolicy (readonly)



71
72
73
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 71

def redact_pii_sub
  @redact_pii_sub
end

#sentiment_analysisBoolean (readonly)

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

Returns:



103
104
105
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 103

def sentiment_analysis
  @sentiment_analysis
end

#speaker_labelsBoolean (readonly)

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

Returns:



75
76
77
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 75

def speaker_labels
  @speaker_labels
end

#speakers_expectedInteger (readonly)

Returns Tells 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:



80
81
82
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 80

def speakers_expected
  @speakers_expected
end

#speech_modelAssemblyAI::Transcripts::SpeechModel (readonly)



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

def speech_model
  @speech_model
end

#speech_thresholdFloat (readonly)

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

Returns:

  • (Float)

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



113
114
115
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 113

def speech_threshold
  @speech_threshold
end

#summarizationBoolean (readonly)

Returns Enable [Summarization](www.assemblyai.com/docs/models/summarization), can be true or false.

Returns:



116
117
118
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 116

def summarization
  @summarization
end

#summary_modelAssemblyAI::Transcripts::SummaryModel (readonly)

Returns The model to summarize the transcript.

Returns:



118
119
120
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 118

def summary_model
  @summary_model
end

#summary_typeAssemblyAI::Transcripts::SummaryType (readonly)

Returns The type of summary.

Returns:



120
121
122
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 120

def summary_type
  @summary_type
end

#topicsArray<String> (readonly)

Returns The list of custom topics.

Returns:

  • (Array<String>)

    The list of custom topics



124
125
126
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 124

def topics
  @topics
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



37
38
39
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 37

def webhook_auth_header_name
  @webhook_auth_header_name
end

#webhook_auth_header_valueString (readonly)

Returns The header value to send back with the transcript completed or failed webhook requests for added security.

Returns:

  • (String)

    The header value to send back with the transcript completed or failed webhook requests for added security



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

def webhook_auth_header_value
  @webhook_auth_header_value
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.



34
35
36
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 34

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



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

def word_boost
  @word_boost
end

Class Method Details

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

Deserialize a JSON object to an instance of TranscriptOptionalParams

Parameters:

  • json_object (String)

Returns:



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
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
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 290

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  language_code = struct["language_code"]
  punctuate = struct["punctuate"]
  format_text = struct["format_text"]
  dual_channel = struct["dual_channel"]
  speech_model = struct["speech_model"]
  webhook_url = struct["webhook_url"]
  webhook_auth_header_name = struct["webhook_auth_header_name"]
  webhook_auth_header_value = struct["webhook_auth_header_value"]
  auto_highlights = struct["auto_highlights"]
  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"]
  content_safety_confidence = struct["content_safety_confidence"]
  iab_categories = struct["iab_categories"]
  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
  disfluencies = struct["disfluencies"]
  sentiment_analysis = struct["sentiment_analysis"]
  auto_chapters = struct["auto_chapters"]
  entity_detection = struct["entity_detection"]
  speech_threshold = struct["speech_threshold"]
  summarization = struct["summarization"]
  summary_model = struct["summary_model"]
  summary_type = struct["summary_type"]
  custom_topics = struct["custom_topics"]
  topics = struct["topics"]
  new(
    language_code: language_code,
    punctuate: punctuate,
    format_text: format_text,
    dual_channel: dual_channel,
    speech_model: speech_model,
    webhook_url: webhook_url,
    webhook_auth_header_name: webhook_auth_header_name,
    webhook_auth_header_value: webhook_auth_header_value,
    auto_highlights: auto_highlights,
    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_confidence: content_safety_confidence,
    iab_categories: iab_categories,
    language_detection: language_detection,
    custom_spelling: custom_spelling,
    disfluencies: disfluencies,
    sentiment_analysis: sentiment_analysis,
    auto_chapters: auto_chapters,
    entity_detection: entity_detection,
    speech_threshold: speech_threshold,
    summarization: summarization,
    summary_model: summary_model,
    summary_type: summary_type,
    custom_topics: custom_topics,
    topics: topics,
    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)


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
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 386

def self.validate_raw(obj:)
  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.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_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.webhook_auth_header_value&.is_a?(String) != false || raise("Passed value for field obj.webhook_auth_header_value 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.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?(AssemblyAI::Transcripts::TranscriptBoostParam) != 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_confidence&.is_a?(Integer) != false || raise("Passed value for field obj.content_safety_confidence is not the expected type, validation failed.")
  obj.iab_categories&.is_a?(Boolean) != false || raise("Passed value for field obj.iab_categories is not the expected type, validation failed.")
  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.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.auto_chapters&.is_a?(Boolean) != false || raise("Passed value for field obj.auto_chapters 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.speech_threshold&.is_a?(Float) != false || raise("Passed value for field obj.speech_threshold 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_model&.is_a?(AssemblyAI::Transcripts::SummaryModel) != false || raise("Passed value for field obj.summary_model is not the expected type, validation failed.")
  obj.summary_type&.is_a?(AssemblyAI::Transcripts::SummaryType) != false || raise("Passed value for field obj.summary_type 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.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of TranscriptOptionalParams to a JSON object

Returns:

  • (String)


376
377
378
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 376

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