Class: AssemblyAI::Transcripts::TranscriptOptionalParams
- Inherits:
-
Object
- Object
- AssemblyAI::Transcripts::TranscriptOptionalParams
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#audio_end_at ⇒ Integer
readonly
The point in time, in milliseconds, to stop transcribing in your media file.
-
#audio_start_from ⇒ Integer
readonly
The point in time, in milliseconds, to begin transcribing in your media file.
-
#auto_chapters ⇒ Boolean
readonly
Enable [Auto Chapters](www.assemblyai.com/docs/models/auto-chapters), can be true or false.
-
#auto_highlights ⇒ Boolean
readonly
Enable Key Phrases, either true or false.
-
#boost_param ⇒ AssemblyAI::Transcripts::TranscriptBoostParam
readonly
How much to boost specified words.
-
#content_safety ⇒ Boolean
readonly
Enable [Content Moderation](www.assemblyai.com/docs/models/content-moderation), can be true or false.
-
#content_safety_confidence ⇒ Integer
readonly
The confidence threshold for the Content Moderation model.
-
#custom_spelling ⇒ Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>
readonly
Customize how words are spelled and formatted using to and from values.
-
#custom_topics ⇒ Boolean
readonly
Enable custom topics, either true or false.
-
#disfluencies ⇒ Boolean
readonly
Transcribe Filler Words, like “umm”, in your media file; can be true or false.
-
#dual_channel ⇒ Boolean
readonly
Enable [Dual ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.
-
#entity_detection ⇒ Boolean
readonly
Enable [Entity Detection](www.assemblyai.com/docs/models/entity-detection), can be true or false.
-
#filter_profanity ⇒ Boolean
readonly
Filter profanity from the transcribed text, can be true or false.
-
#format_text ⇒ Boolean
readonly
Enable Text Formatting, can be true or false.
-
#iab_categories ⇒ Boolean
readonly
Enable [Topic Detection](www.assemblyai.com/docs/models/topic-detection), can be true or false.
- #language_code ⇒ AssemblyAI::Transcripts::TranscriptLanguageCode readonly
-
#language_confidence_threshold ⇒ Float
readonly
The confidence threshold for the automatically detected language.
-
#language_detection ⇒ Boolean
readonly
Enable [Automatic language www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.
-
#multichannel ⇒ Boolean
readonly
Enable ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) transcription, can be true or false.
-
#punctuate ⇒ Boolean
readonly
Enable Automatic Punctuation, can be true or false.
-
#redact_pii ⇒ Boolean
readonly
Redact PII from the transcribed text using the Redact PII model, can be true or false.
-
#redact_pii_audio ⇒ Boolean
readonly
Generate a copy of the original media file with spoken PII “beeped” out, can be true or false.
-
#redact_pii_audio_quality ⇒ AssemblyAI::Transcripts::RedactPiiAudioQuality
readonly
Controls the filetype of the audio created by redact_pii_audio.
-
#redact_pii_policies ⇒ Array<AssemblyAI::Transcripts::PiiPolicy>
readonly
The list of PII Redaction policies to enable.
- #redact_pii_sub ⇒ AssemblyAI::Transcripts::SubstitutionPolicy readonly
-
#sentiment_analysis ⇒ Boolean
readonly
Enable [Sentiment Analysis](www.assemblyai.com/docs/models/sentiment-analysis), can be true or false.
-
#speaker_labels ⇒ Boolean
readonly
Enable [Speaker diarization](www.assemblyai.com/docs/models/speaker-diarization), can be true or false.
-
#speakers_expected ⇒ Integer
readonly
Tells the speaker label model how many speakers it should attempt to identify, up to 10.
- #speech_model ⇒ AssemblyAI::Transcripts::SpeechModel readonly
-
#speech_threshold ⇒ Float
readonly
Reject audio files that contain less than this fraction of speech.
-
#summarization ⇒ Boolean
readonly
Enable [Summarization](www.assemblyai.com/docs/models/summarization), can be true or false.
-
#summary_model ⇒ AssemblyAI::Transcripts::SummaryModel
readonly
The model to summarize the transcript.
-
#summary_type ⇒ AssemblyAI::Transcripts::SummaryType
readonly
The type of summary.
-
#topics ⇒ Array<String>
readonly
The list of custom topics.
-
#webhook_auth_header_name ⇒ String
readonly
The header name to be sent with the transcript completed or failed webhook requests.
-
#webhook_auth_header_value ⇒ String
readonly
The header value to send back with the transcript completed or failed webhook requests for added security.
-
#webhook_url ⇒ String
readonly
The URL to which we send webhook requests.
-
#word_boost ⇒ Array<String>
readonly
The list of custom vocabulary to boost transcription probability for.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ AssemblyAI::Transcripts::TranscriptOptionalParams
Deserialize a JSON object to an instance of TranscriptOptionalParams.
-
.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.
Instance Method Summary collapse
- #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 constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TranscriptOptionalParams to a JSON object.
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
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_properties ⇒ OpenStruct (readonly)
Returns 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_at ⇒ Integer (readonly)
Returns 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_from ⇒ Integer (readonly)
Returns 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_chapters ⇒ Boolean (readonly)
Returns Enable [Auto Chapters](www.assemblyai.com/docs/models/auto-chapters), can be true or false.
115 116 117 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 115 def auto_chapters @auto_chapters end |
#auto_highlights ⇒ Boolean (readonly)
Returns 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_param ⇒ AssemblyAI::Transcripts::TranscriptBoostParam (readonly)
Returns How much to boost specified words.
65 66 67 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 65 def boost_param @boost_param end |
#content_safety ⇒ Boolean (readonly)
Returns Enable [Content Moderation](www.assemblyai.com/docs/models/content-moderation), can be true or false.
99 100 101 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 99 def content_safety @content_safety end |
#content_safety_confidence ⇒ Integer (readonly)
Returns 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_spelling ⇒ Array<AssemblyAI::Transcripts::TranscriptCustomSpelling> (readonly)
Returns Customize how words are spelled and formatted using to and from values.
108 109 110 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 108 def custom_spelling @custom_spelling end |
#custom_topics ⇒ Boolean (readonly)
Returns 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 |
#disfluencies ⇒ Boolean (readonly)
Returns 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_channel ⇒ Boolean (readonly)
Returns Enable [Dual ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.
44 45 46 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 44 def dual_channel @dual_channel end |
#entity_detection ⇒ Boolean (readonly)
Returns Enable [Entity Detection](www.assemblyai.com/docs/models/entity-detection), can be true or false.
119 120 121 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 119 def entity_detection @entity_detection end |
#filter_profanity ⇒ Boolean (readonly)
Returns 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_text ⇒ Boolean (readonly)
Returns 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_categories ⇒ Boolean (readonly)
Returns Enable [Topic Detection](www.assemblyai.com/docs/models/topic-detection), can be true or false.
106 107 108 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 106 def iab_categories @iab_categories end |
#language_code ⇒ AssemblyAI::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_threshold ⇒ Float (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.
28 29 30 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 28 def language_confidence_threshold @language_confidence_threshold end |
#language_detection ⇒ Boolean (readonly)
Returns Enable [Automatic language www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.
24 25 26 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 24 def language_detection @language_detection end |
#multichannel ⇒ Boolean (readonly)
Returns Enable ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) transcription, can be true or false.
40 41 42 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 40 def multichannel @multichannel end |
#punctuate ⇒ Boolean (readonly)
Returns 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_pii ⇒ Boolean (readonly)
Returns 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_audio ⇒ Boolean (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.
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_quality ⇒ AssemblyAI::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.
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_policies ⇒ Array<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.
84 85 86 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 84 def redact_pii_policies @redact_pii_policies end |
#redact_pii_sub ⇒ AssemblyAI::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_analysis ⇒ Boolean (readonly)
Returns Enable [Sentiment Analysis](www.assemblyai.com/docs/models/sentiment-analysis), can be true or false.
112 113 114 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 112 def sentiment_analysis @sentiment_analysis end |
#speaker_labels ⇒ Boolean (readonly)
Returns Enable [Speaker diarization](www.assemblyai.com/docs/models/speaker-diarization), can be true or false.
90 91 92 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 90 def speaker_labels @speaker_labels end |
#speakers_expected ⇒ Integer (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.
95 96 97 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 95 def speakers_expected @speakers_expected end |
#speech_model ⇒ AssemblyAI::Transcripts::SpeechModel (readonly)
30 31 32 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 30 def speech_model @speech_model end |
#speech_threshold ⇒ Float (readonly)
Returns 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 |
#summarization ⇒ Boolean (readonly)
Returns Enable [Summarization](www.assemblyai.com/docs/models/summarization), can be true or false.
125 126 127 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 125 def summarization @summarization end |
#summary_model ⇒ AssemblyAI::Transcripts::SummaryModel (readonly)
Returns The model to summarize the transcript.
127 128 129 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 127 def summary_model @summary_model end |
#summary_type ⇒ AssemblyAI::Transcripts::SummaryType (readonly)
Returns The type of summary.
129 130 131 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 129 def summary_type @summary_type end |
#topics ⇒ Array<String> (readonly)
Returns 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_name ⇒ String (readonly)
Returns 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_value ⇒ String (readonly)
Returns 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_url ⇒ String (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.
49 50 51 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 49 def webhook_url @webhook_url end |
#word_boost ⇒ Array<String> (readonly)
Returns 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
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.
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
400 401 402 |
# File 'lib/assemblyai/transcripts/types/transcript_optional_params.rb', line 400 def to_json(*_args) @_field_set&.to_json end |