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, language_detection: OMIT, language_confidence_threshold: OMIT, speech_model: OMIT, punctuate: OMIT, format_text: OMIT, disfluencies: OMIT, multichannel: OMIT, dual_channel: 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, custom_spelling: 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)
  • language_detection (Boolean) (defaults to: OMIT)

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

  • language_confidence_threshold (Float) (defaults to: OMIT)

    The confidence threshold for the automatically detected language. An error will be returned if the language confidence is below this threshold. Defaults to 0.

  • speech_model (AssemblyAI::Transcripts::SpeechModel) (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

  • disfluencies (Boolean) (defaults to: OMIT)

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

  • multichannel (Boolean) (defaults to: OMIT)
  • dual_channel (Boolean) (defaults to: OMIT)

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

  • 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)

    How much to boost specified words

  • 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

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

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

  • 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



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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 221

def initialize(language_code: OMIT, language_detection: OMIT, language_confidence_threshold: OMIT,
               speech_model: OMIT, punctuate: OMIT, format_text: OMIT, disfluencies: OMIT, multichannel: OMIT, dual_channel: 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, custom_spelling: 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
  @language_detection = language_detection if language_detection != OMIT
  @language_confidence_threshold = language_confidence_threshold if language_confidence_threshold != OMIT
  @speech_model = speech_model if speech_model != OMIT
  @punctuate = punctuate if punctuate != OMIT
  @format_text = format_text if format_text != OMIT
  @disfluencies = disfluencies if disfluencies != OMIT
  @multichannel = multichannel if multichannel != OMIT
  @dual_channel = dual_channel if dual_channel != 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
  @custom_spelling = custom_spelling if custom_spelling != 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,
    "language_detection": language_detection,
    "language_confidence_threshold": language_confidence_threshold,
    "speech_model": speech_model,
    "punctuate": punctuate,
    "format_text": format_text,
    "disfluencies": disfluencies,
    "multichannel": multichannel,
    "dual_channel": dual_channel,
    "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,
    "custom_spelling": custom_spelling,
    "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



135
136
137
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 135

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



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

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



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

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:



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

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



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

def auto_highlights
  @auto_highlights
end

#boost_paramAssemblyAI::Transcripts::TranscriptBoostParam (readonly)

Returns How much to boost specified words.

Returns:



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

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:



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

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.



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

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:



108
109
110
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 108

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



131
132
133
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 131

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



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

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:



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

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:



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

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



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

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



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

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:



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

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_confidence_thresholdFloat (readonly)

Returns The confidence threshold for the automatically detected language. An error will be returned if the language confidence is below this threshold. Defaults to 0.

Returns:

  • (Float)

    The confidence threshold for the automatically detected language. An error will be returned if the language confidence is below this threshold. Defaults to 0.



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

def language_confidence_threshold
  @language_confidence_threshold
end

#language_detectionBoolean (readonly)

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

Returns:



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

def language_detection
  @language_detection
end

#multichannelBoolean (readonly)

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

Returns:



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

def multichannel
  @multichannel
end

#punctuateBoolean (readonly)

Returns Enable Automatic Punctuation, can be true or false.

Returns:

  • (Boolean)

    Enable Automatic Punctuation, can be true or false



32
33
34
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 32

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



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

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:



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

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:



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

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:



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

def redact_pii_policies
  @redact_pii_policies
end

#redact_pii_subAssemblyAI::Transcripts::SubstitutionPolicy (readonly)



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

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:



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

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:



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

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:



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

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.



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

def speech_threshold
  @speech_threshold
end

#summarizationBoolean (readonly)

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

Returns:



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

def summarization
  @summarization
end

#summary_modelAssemblyAI::Transcripts::SummaryModel (readonly)

Returns The model to summarize the transcript.

Returns:



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

def summary_model
  @summary_model
end

#summary_typeAssemblyAI::Transcripts::SummaryType (readonly)

Returns The type of summary.

Returns:



129
130
131
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 129

def summary_type
  @summary_type
end

#topicsArray<String> (readonly)

Returns The list of custom topics.

Returns:

  • (Array<String>)

    The list of custom topics



133
134
135
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 133

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



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

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



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

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.



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

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



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

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:



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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 310

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"]
  language_detection = struct["language_detection"]
  language_confidence_threshold = struct["language_confidence_threshold"]
  speech_model = struct["speech_model"]
  punctuate = struct["punctuate"]
  format_text = struct["format_text"]
  disfluencies = struct["disfluencies"]
  multichannel = struct["multichannel"]
  dual_channel = struct["dual_channel"]
  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"]
  custom_spelling = parsed_json["custom_spelling"]&.map do |v|
    v = v.to_json
    AssemblyAI::Transcripts::TranscriptCustomSpelling.from_json(json_object: v)
  end
  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,
    language_detection: language_detection,
    language_confidence_threshold: language_confidence_threshold,
    speech_model: speech_model,
    punctuate: punctuate,
    format_text: format_text,
    disfluencies: disfluencies,
    multichannel: multichannel,
    dual_channel: dual_channel,
    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,
    custom_spelling: custom_spelling,
    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)


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

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.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
  obj.language_confidence_threshold&.is_a?(Float) != false || raise("Passed value for field obj.language_confidence_threshold 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.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.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
  obj.multichannel&.is_a?(Boolean) != false || raise("Passed value for field obj.multichannel 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.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.custom_spelling&.is_a?(Array) != false || raise("Passed value for field obj.custom_spelling 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)


400
401
402
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 400

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