assemblyai 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b63883242572f840626aaf3371a3f1800b83dfcddeec11b94e5bfd3d4e46781
4
- data.tar.gz: 5589337613a9087e9e34fb666ca440dbfc22e544c3f16e5fdfbc99b6504cf1fa
3
+ metadata.gz: 829ed3bd27fb8aac58b6250478b6c4c077bf27c38a23190cab5a1781945bac99
4
+ data.tar.gz: d015981babb1021cb9418f51e1256751b91986aa8fcfb7344bbc243f660b5fdf
5
5
  SHA512:
6
- metadata.gz: 427e91e5bb38960b0626a58a4e848e88d07bd6e522866098f4228a026858dca77d7d0ea202e0fbc7ed75a80fc19915f6d314c44c34f9f2ecb14b833eab4dbb66
7
- data.tar.gz: 31e206f2d31ceb3dd11369a5a7ffc1ba0f0ee4d834028761ab4eb8e534c54e34b9cd338801892c6439bcef324e15e5b3cbf76b67f6440f09943cf30fd7f2ed1c
6
+ metadata.gz: 63e1f0d2256aff704d10fe8c77a0897c8826053d0838468b2f0530ee9438f8af3262568cf8a14417b7c5824e0a78e4cf813eb0767e56341093b18982c939401d
7
+ data.tar.gz: cfbb7ab4a8e5c2b196abf7ea0ee2d31b08115b7e2017f13ecfe17386e10b02c27c0e2b83649da86f922d13836ea78046035fb182740a6d659a93088cdc024fc8
@@ -10,6 +10,7 @@ module AssemblyAI
10
10
  ANTHROPIC_CLAUDE3_SONNET = "anthropic/claude-3-sonnet"
11
11
  ANTHROPIC_CLAUDE2_1 = "anthropic/claude-2-1"
12
12
  ANTHROPIC_CLAUDE2 = "anthropic/claude-2"
13
+ ANTHROPIC_CLAUDE2_0 = "anthropic/claude-2"
13
14
  DEFAULT = "default"
14
15
  ANTHROPIC_CLAUDE_INSTANT1_2 = "anthropic/claude-instant-1-2"
15
16
  BASIC = "basic"
@@ -35,7 +35,7 @@ module AssemblyAI
35
35
  # Transcripts are sorted from newest to oldest. The previous URL always points to
36
36
  # a page with older transcripts.
37
37
  #
38
- # @param limit [Long] Maximum amount of transcripts to retrieve
38
+ # @param limit [Integer] Maximum amount of transcripts to retrieve
39
39
  # @param status [AssemblyAI::Transcripts::TranscriptStatus] Filter by transcript status
40
40
  # @param created_on [String] Only get transcripts created on this date
41
41
  # @param before_id [String] Get transcripts that were created before this transcript ID
@@ -83,12 +83,16 @@ module AssemblyAI
83
83
  # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
84
84
  # @param format_text [Boolean] Enable Text Formatting, can be true or false
85
85
  # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
86
+ # @param multichannel [Boolean] Enable
87
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
88
+ # transcription, can be true or false.
86
89
  # @param dual_channel [Boolean] Enable [Dual
87
90
  # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
88
91
  # transcription, can be true or false.
89
- # @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of
90
- # webhook requests. One request when a transcript is completed or failed, and one
91
- # request when the redacted audio is ready if redact_pii_audio is enabled.
92
+ # @param webhook_url [String] The URL to which we send webhook requests.
93
+ # We sends two different types of webhook requests.
94
+ # One request when a transcript is completed or failed, and one request when the
95
+ # redacted audio is ready if redact_pii_audio is enabled.
92
96
  # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook
93
97
  # requests
94
98
  # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook
@@ -156,9 +160,9 @@ module AssemblyAI
156
160
  # base_url: "https://api.example.com",
157
161
  # api_key: "YOUR_API_KEY"
158
162
  # )
159
- # api.transcripts.submit(audio_url: "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3")
163
+ # api.transcripts.submit(audio_url: "https://assembly.ai/wildfires.mp3")
160
164
  def submit(audio_url:, language_code: nil, language_detection: nil, language_confidence_threshold: nil, speech_model: nil,
161
- punctuate: nil, format_text: nil, disfluencies: nil, dual_channel: nil, webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, custom_spelling: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil)
165
+ punctuate: nil, format_text: nil, disfluencies: nil, multichannel: nil, dual_channel: nil, webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, custom_spelling: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil)
162
166
  response = @request_client.conn.post do |req|
163
167
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
164
168
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
@@ -172,6 +176,7 @@ module AssemblyAI
172
176
  punctuate: punctuate,
173
177
  format_text: format_text,
174
178
  disfluencies: disfluencies,
179
+ multichannel: multichannel,
175
180
  dual_channel: dual_channel,
176
181
  webhook_url: webhook_url,
177
182
  webhook_auth_header_name: webhook_auth_header_name,
@@ -380,7 +385,7 @@ module AssemblyAI
380
385
  # Transcripts are sorted from newest to oldest. The previous URL always points to
381
386
  # a page with older transcripts.
382
387
  #
383
- # @param limit [Long] Maximum amount of transcripts to retrieve
388
+ # @param limit [Integer] Maximum amount of transcripts to retrieve
384
389
  # @param status [AssemblyAI::Transcripts::TranscriptStatus] Filter by transcript status
385
390
  # @param created_on [String] Only get transcripts created on this date
386
391
  # @param before_id [String] Get transcripts that were created before this transcript ID
@@ -430,12 +435,16 @@ module AssemblyAI
430
435
  # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
431
436
  # @param format_text [Boolean] Enable Text Formatting, can be true or false
432
437
  # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
438
+ # @param multichannel [Boolean] Enable
439
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
440
+ # transcription, can be true or false.
433
441
  # @param dual_channel [Boolean] Enable [Dual
434
442
  # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
435
443
  # transcription, can be true or false.
436
- # @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of
437
- # webhook requests. One request when a transcript is completed or failed, and one
438
- # request when the redacted audio is ready if redact_pii_audio is enabled.
444
+ # @param webhook_url [String] The URL to which we send webhook requests.
445
+ # We sends two different types of webhook requests.
446
+ # One request when a transcript is completed or failed, and one request when the
447
+ # redacted audio is ready if redact_pii_audio is enabled.
439
448
  # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook
440
449
  # requests
441
450
  # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook
@@ -503,9 +512,9 @@ module AssemblyAI
503
512
  # base_url: "https://api.example.com",
504
513
  # api_key: "YOUR_API_KEY"
505
514
  # )
506
- # api.transcripts.submit(audio_url: "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3")
515
+ # api.transcripts.submit(audio_url: "https://assembly.ai/wildfires.mp3")
507
516
  def submit(audio_url:, language_code: nil, language_detection: nil, language_confidence_threshold: nil, speech_model: nil,
508
- punctuate: nil, format_text: nil, disfluencies: nil, dual_channel: nil, webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, custom_spelling: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil)
517
+ punctuate: nil, format_text: nil, disfluencies: nil, multichannel: nil, dual_channel: nil, webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, custom_spelling: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil)
509
518
  Async do
510
519
  response = @request_client.conn.post do |req|
511
520
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -520,6 +529,7 @@ module AssemblyAI
520
529
  punctuate: punctuate,
521
530
  format_text: format_text,
522
531
  disfluencies: disfluencies,
532
+ multichannel: multichannel,
523
533
  dual_channel: dual_channel,
524
534
  webhook_url: webhook_url,
525
535
  webhook_auth_header_name: webhook_auth_header_name,
@@ -26,53 +26,93 @@ module AssemblyAI
26
26
  # Create a transcript from an audio or video file that is accessible via a URL.
27
27
  # .transcribe polls for completion of the transcription, while the .submit function does not.
28
28
  #
29
- # @param speech_model [Transcripts::SpeechModel]
30
- # @param language_code [Transcripts::TranscriptLanguageCode]
29
+ # @param language_code [AssemblyAI::Transcripts::TranscriptLanguageCode]
30
+ # @param language_detection [Boolean] Enable [Automatic language
31
+ # www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection),
32
+ # either true or false.
33
+ # @param language_confidence_threshold [Float] The confidence threshold for the automatically detected language.
34
+ # An error will be returned if the language confidence is below this threshold.
35
+ # Defaults to 0.
36
+ # @param speech_model [AssemblyAI::Transcripts::SpeechModel]
31
37
  # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
32
38
  # @param format_text [Boolean] Enable Text Formatting, can be true or false
33
- # @param dual_channel [Boolean] Enable [Dual Channel](https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.
34
- # @param webhook_url [String] The URL to which AssemblyAI send webhooks upon transcription completion
35
- # @param webhook_auth_header_name [String] The header name which should be sent back with webhook calls
36
- # @param webhook_auth_header_value [String] Specify a header name and value to send back with a webhook call for added security
37
- # @param auto_highlights [Boolean] Whether Key Phrases is enabled, either true or false
39
+ # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
40
+ # @param multichannel [Boolean] Enable
41
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
42
+ # transcription, can be true or false.
43
+ # @param dual_channel [Boolean] Enable [Dual
44
+ # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
45
+ # transcription, can be true or false.
46
+ # @param webhook_url [String] The URL to which we send webhook requests.
47
+ # We sends two different types of webhook requests.
48
+ # One request when a transcript is completed or failed, and one request when the
49
+ # redacted audio is ready if redact_pii_audio is enabled.
50
+ # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook
51
+ # requests
52
+ # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook
53
+ # requests for added security
54
+ # @param auto_highlights [Boolean] Enable Key Phrases, either true or false
38
55
  # @param audio_start_from [Integer] The point in time, in milliseconds, to begin transcribing in your media file
39
56
  # @param audio_end_at [Integer] The point in time, in milliseconds, to stop transcribing in your media file
40
57
  # @param word_boost [Array<String>] The list of custom vocabulary to boost transcription probability for
41
- # @param boost_param [Transcripts::TranscriptBoostParam] The word boost parameter value
58
+ # @param boost_param [AssemblyAI::Transcripts::TranscriptBoostParam] How much to boost specified words
42
59
  # @param filter_profanity [Boolean] Filter profanity from the transcribed text, can be true or false
43
- # @param redact_pii [Boolean] Redact PII from the transcribed text using the Redact PII model, can be true or false
44
- # @param redact_pii_audio [Boolean] Generate a copy of the original media file with spoken PII "beeped" out, can be true or false. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
45
- # @param redact_pii_audio_quality [Transcripts::RedactPiiAudioQuality] Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
46
- # @param redact_pii_policies [Array<Transcripts::PiiPolicy>] The list of PII Redaction policies to enable. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
47
- # @param redact_pii_sub [Transcripts::SubstitutionPolicy]
48
- # @param speaker_labels [Boolean] Enable [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization), can be true or false
49
- # @param speakers_expected [Integer] Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) for more details.
50
- # @param content_safety [Boolean] Enable [Content Moderation](https://www.assemblyai.com/docs/models/content-moderation), can be true or false
51
- # @param content_safety_confidence [Integer] The confidence threshold for content moderation. Values must be between 25 and 100.
52
- # @param iab_categories [Boolean] Enable [Topic Detection](https://www.assemblyai.com/docs/models/topic-detection), can be true or false
53
- # @param language_detection [Boolean] Whether [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection) was enabled in the transcription request, either true or false.
54
- # @param custom_spelling [Array<Hash>] Customize how words are spelled and formatted using to and from valuesRequest of type Array<Transcripts::TranscriptCustomSpelling>, as a Hash
60
+ # @param redact_pii [Boolean] Redact PII from the transcribed text using the Redact PII model, can be true or
61
+ # false
62
+ # @param redact_pii_audio [Boolean] Generate a copy of the original media file with spoken PII "beeped" out, can be
63
+ # true or false. See [PII
64
+ # redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more
65
+ # details.
66
+ # @param redact_pii_audio_quality [AssemblyAI::Transcripts::RedactPiiAudioQuality] Controls the filetype of the audio created by redact_pii_audio. Currently
67
+ # supports mp3 (default) and wav. See [PII
68
+ # redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more
69
+ # details.
70
+ # @param redact_pii_policies [Array<AssemblyAI::Transcripts::PiiPolicy>] The list of PII Redaction policies to enable. See [PII
71
+ # redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more
72
+ # details.
73
+ # @param redact_pii_sub [AssemblyAI::Transcripts::SubstitutionPolicy]
74
+ # @param speaker_labels [Boolean] Enable [Speaker
75
+ # diarization](https://www.assemblyai.com/docs/models/speaker-diarization), can be
76
+ # true or false
77
+ # @param speakers_expected [Integer] Tells the speaker label model how many speakers it should attempt to identify,
78
+ # up to 10. See [Speaker
79
+ # diarization](https://www.assemblyai.com/docs/models/speaker-diarization) for
80
+ # more details.
81
+ # @param content_safety [Boolean] Enable [Content
82
+ # Moderation](https://www.assemblyai.com/docs/models/content-moderation), can be
83
+ # true or false
84
+ # @param content_safety_confidence [Integer] The confidence threshold for the Content Moderation model. Values must be
85
+ # between 25 and 100.
86
+ # @param iab_categories [Boolean] Enable [Topic
87
+ # Detection](https://www.assemblyai.com/docs/models/topic-detection), can be true
88
+ # or false
89
+ # @param custom_spelling [Array<Hash>] Customize how words are spelled and formatted using to and from valuesRequest of type Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>, as a Hash
55
90
  # * :from (Array<String>)
56
91
  # * :to (String)
57
- # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
58
- # @param sentiment_analysis [Boolean] Enable [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be true or false
59
- # @param auto_chapters [Boolean] Enable [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters), can be true or false
60
- # @param entity_detection [Boolean] Enable [Entity Detection](https://www.assemblyai.com/docs/models/entity-detection), can be true or false
92
+ # @param sentiment_analysis [Boolean] Enable [Sentiment
93
+ # Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be
94
+ # true or false
95
+ # @param auto_chapters [Boolean] Enable [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters),
96
+ # can be true or false
97
+ # @param entity_detection [Boolean] Enable [Entity
98
+ # Detection](https://www.assemblyai.com/docs/models/entity-detection), can be true
99
+ # or false
61
100
  # @param speech_threshold [Float] Reject audio files that contain less than this fraction of speech.
62
- # Valid values are in the range [0, 1] inclusive.
63
- # @param summarization [Boolean] Enable [Summarization](https://www.assemblyai.com/docs/models/summarization), can be true or false
64
- # @param summary_model [Transcripts::SummaryModel] The model to summarize the transcript
65
- # @param summary_type [Transcripts::SummaryType] The type of summary
66
- # @param custom_topics [Boolean] Whether custom topics is enabled, either true or false
67
- # @param topics [Array<String>] The list of custom topics provided, if custom topics is enabled
101
+ # Valid values are in the range [0, 1] inclusive.
102
+ # @param summarization [Boolean] Enable [Summarization](https://www.assemblyai.com/docs/models/summarization),
103
+ # can be true or false
104
+ # @param summary_model [AssemblyAI::Transcripts::SummaryModel] The model to summarize the transcript
105
+ # @param summary_type [AssemblyAI::Transcripts::SummaryType] The type of summary
106
+ # @param custom_topics [Boolean] Enable custom topics, either true or false
107
+ # @param topics [Array<String>] The list of custom topics
68
108
  # @param audio_url [String] The URL of the audio or video file to transcribe.
69
- # @param request_options [RequestOptions]
109
+ # @param request_options [AssemblyAI::RequestOptions]
70
110
  # @param polling_options [Transcripts::PollingOptions] Configuration options for polling requests.
71
111
  # @return [Transcripts::Transcript]
72
- def transcribe(audio_url:, speech_model: nil, language_code: nil, punctuate: nil, format_text: nil, dual_channel: nil,
73
- webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, language_detection: nil, custom_spelling: nil, disfluencies: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil, polling_options: Transcripts::PollingOptions.new)
112
+ def transcribe(audio_url:, language_code: nil, language_detection: nil, language_confidence_threshold: nil, speech_model: nil,
113
+ punctuate: nil, format_text: nil, disfluencies: nil, multichannel: nil, dual_channel: nil, webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, custom_spelling: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil, polling_options: Transcripts::PollingOptions.new)
74
114
  transcript = submit(audio_url: audio_url, speech_model: speech_model, language_code: language_code, punctuate: punctuate, format_text: format_text, dual_channel: dual_channel,
75
- 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, request_options: request_options)
115
+ 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, language_confidence_threshold: language_confidence_threshold, custom_spelling: custom_spelling, disfluencies: disfluencies, multichannel: multichannel, 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, request_options: request_options)
76
116
  wait_until_ready(transcript_id: transcript.id, polling_options: polling_options)
77
117
  end
78
118
 
@@ -102,54 +142,94 @@ module AssemblyAI
102
142
  # Create a transcript from an audio or video file that is accessible via a URL.
103
143
  # .transcribe polls for completion of the transcription, while the .submit function does not.
104
144
  #
105
- # @param speech_model [Transcripts::SpeechModel]
106
- # @param language_code [Transcripts::TranscriptLanguageCode]
145
+ # @param language_code [AssemblyAI::Transcripts::TranscriptLanguageCode]
146
+ # @param language_detection [Boolean] Enable [Automatic language
147
+ # www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection),
148
+ # either true or false.
149
+ # @param language_confidence_threshold [Float] The confidence threshold for the automatically detected language.
150
+ # An error will be returned if the language confidence is below this threshold.
151
+ # Defaults to 0.
152
+ # @param speech_model [AssemblyAI::Transcripts::SpeechModel]
107
153
  # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
108
154
  # @param format_text [Boolean] Enable Text Formatting, can be true or false
109
- # @param dual_channel [Boolean] Enable [Dual Channel](https://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) transcription, can be true or false.
110
- # @param webhook_url [String] The URL to which AssemblyAI send webhooks upon transcription completion
111
- # @param webhook_auth_header_name [String] The header name which should be sent back with webhook calls
112
- # @param webhook_auth_header_value [String] Specify a header name and value to send back with a webhook call for added security
113
- # @param auto_highlights [Boolean] Whether Key Phrases is enabled, either true or false
155
+ # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
156
+ # @param multichannel [Boolean] Enable
157
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
158
+ # transcription, can be true or false.
159
+ # @param dual_channel [Boolean] Enable [Dual
160
+ # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
161
+ # transcription, can be true or false.
162
+ # @param webhook_url [String] The URL to which we send webhook requests.
163
+ # We sends two different types of webhook requests.
164
+ # One request when a transcript is completed or failed, and one request when the
165
+ # redacted audio is ready if redact_pii_audio is enabled.
166
+ # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook
167
+ # requests
168
+ # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook
169
+ # requests for added security
170
+ # @param auto_highlights [Boolean] Enable Key Phrases, either true or false
114
171
  # @param audio_start_from [Integer] The point in time, in milliseconds, to begin transcribing in your media file
115
172
  # @param audio_end_at [Integer] The point in time, in milliseconds, to stop transcribing in your media file
116
173
  # @param word_boost [Array<String>] The list of custom vocabulary to boost transcription probability for
117
- # @param boost_param [Transcripts::TranscriptBoostParam] The word boost parameter value
174
+ # @param boost_param [AssemblyAI::Transcripts::TranscriptBoostParam] How much to boost specified words
118
175
  # @param filter_profanity [Boolean] Filter profanity from the transcribed text, can be true or false
119
- # @param redact_pii [Boolean] Redact PII from the transcribed text using the Redact PII model, can be true or false
120
- # @param redact_pii_audio [Boolean] Generate a copy of the original media file with spoken PII "beeped" out, can be true or false. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
121
- # @param redact_pii_audio_quality [Transcripts::RedactPiiAudioQuality] Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
122
- # @param redact_pii_policies [Array<Transcripts::PiiPolicy>] The list of PII Redaction policies to enable. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
123
- # @param redact_pii_sub [Transcripts::SubstitutionPolicy]
124
- # @param speaker_labels [Boolean] Enable [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization), can be true or false
125
- # @param speakers_expected [Integer] Tells the speaker label model how many speakers it should attempt to identify, up to 10. See [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) for more details.
126
- # @param content_safety [Boolean] Enable [Content Moderation](https://www.assemblyai.com/docs/models/content-moderation), can be true or false
127
- # @param content_safety_confidence [Integer] The confidence threshold for content moderation. Values must be between 25 and 100.
128
- # @param iab_categories [Boolean] Enable [Topic Detection](https://www.assemblyai.com/docs/models/topic-detection), can be true or false
129
- # @param language_detection [Boolean] Whether [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection) was enabled in the transcription request, either true or false.
130
- # @param custom_spelling [Array<Hash>] Customize how words are spelled and formatted using to and from valuesRequest of type Array<Transcripts::TranscriptCustomSpelling>, as a Hash
176
+ # @param redact_pii [Boolean] Redact PII from the transcribed text using the Redact PII model, can be true or
177
+ # false
178
+ # @param redact_pii_audio [Boolean] Generate a copy of the original media file with spoken PII "beeped" out, can be
179
+ # true or false. See [PII
180
+ # redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more
181
+ # details.
182
+ # @param redact_pii_audio_quality [AssemblyAI::Transcripts::RedactPiiAudioQuality] Controls the filetype of the audio created by redact_pii_audio. Currently
183
+ # supports mp3 (default) and wav. See [PII
184
+ # redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more
185
+ # details.
186
+ # @param redact_pii_policies [Array<AssemblyAI::Transcripts::PiiPolicy>] The list of PII Redaction policies to enable. See [PII
187
+ # redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more
188
+ # details.
189
+ # @param redact_pii_sub [AssemblyAI::Transcripts::SubstitutionPolicy]
190
+ # @param speaker_labels [Boolean] Enable [Speaker
191
+ # diarization](https://www.assemblyai.com/docs/models/speaker-diarization), can be
192
+ # true or false
193
+ # @param speakers_expected [Integer] Tells the speaker label model how many speakers it should attempt to identify,
194
+ # up to 10. See [Speaker
195
+ # diarization](https://www.assemblyai.com/docs/models/speaker-diarization) for
196
+ # more details.
197
+ # @param content_safety [Boolean] Enable [Content
198
+ # Moderation](https://www.assemblyai.com/docs/models/content-moderation), can be
199
+ # true or false
200
+ # @param content_safety_confidence [Integer] The confidence threshold for the Content Moderation model. Values must be
201
+ # between 25 and 100.
202
+ # @param iab_categories [Boolean] Enable [Topic
203
+ # Detection](https://www.assemblyai.com/docs/models/topic-detection), can be true
204
+ # or false
205
+ # @param custom_spelling [Array<Hash>] Customize how words are spelled and formatted using to and from valuesRequest of type Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>, as a Hash
131
206
  # * :from (Array<String>)
132
207
  # * :to (String)
133
- # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
134
- # @param sentiment_analysis [Boolean] Enable [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be true or false
135
- # @param auto_chapters [Boolean] Enable [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters), can be true or false
136
- # @param entity_detection [Boolean] Enable [Entity Detection](https://www.assemblyai.com/docs/models/entity-detection), can be true or false
208
+ # @param sentiment_analysis [Boolean] Enable [Sentiment
209
+ # Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be
210
+ # true or false
211
+ # @param auto_chapters [Boolean] Enable [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters),
212
+ # can be true or false
213
+ # @param entity_detection [Boolean] Enable [Entity
214
+ # Detection](https://www.assemblyai.com/docs/models/entity-detection), can be true
215
+ # or false
137
216
  # @param speech_threshold [Float] Reject audio files that contain less than this fraction of speech.
138
- # Valid values are in the range [0, 1] inclusive.
139
- # @param summarization [Boolean] Enable [Summarization](https://www.assemblyai.com/docs/models/summarization), can be true or false
140
- # @param summary_model [Transcripts::SummaryModel] The model to summarize the transcript
141
- # @param summary_type [Transcripts::SummaryType] The type of summary
142
- # @param custom_topics [Boolean] Whether custom topics is enabled, either true or false
143
- # @param topics [Array<String>] The list of custom topics provided, if custom topics is enabled
217
+ # Valid values are in the range [0, 1] inclusive.
218
+ # @param summarization [Boolean] Enable [Summarization](https://www.assemblyai.com/docs/models/summarization),
219
+ # can be true or false
220
+ # @param summary_model [AssemblyAI::Transcripts::SummaryModel] The model to summarize the transcript
221
+ # @param summary_type [AssemblyAI::Transcripts::SummaryType] The type of summary
222
+ # @param custom_topics [Boolean] Enable custom topics, either true or false
223
+ # @param topics [Array<String>] The list of custom topics
144
224
  # @param audio_url [String] The URL of the audio or video file to transcribe.
145
- # @param request_options [RequestOptions]
225
+ # @param request_options [AssemblyAI::RequestOptions]
146
226
  # @param polling_options [Transcripts::PollingOptions] Configuration options for polling requests.
147
227
  # @return [Transcripts::Transcript]
148
- def transcribe(audio_url:, speech_model: nil, language_code: nil, punctuate: nil, format_text: nil, dual_channel: nil,
149
- webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, language_detection: nil, custom_spelling: nil, disfluencies: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil, polling_options: Transcripts::PollingOptions.new)
228
+ def transcribe(audio_url:, language_code: nil, language_detection: nil, language_confidence_threshold: nil, speech_model: nil,
229
+ punctuate: nil, format_text: nil, disfluencies: nil, multichannel: nil, dual_channel: nil, webhook_url: nil, webhook_auth_header_name: nil, webhook_auth_header_value: nil, auto_highlights: nil, audio_start_from: nil, audio_end_at: nil, word_boost: nil, boost_param: nil, filter_profanity: nil, redact_pii: nil, redact_pii_audio: nil, redact_pii_audio_quality: nil, redact_pii_policies: nil, redact_pii_sub: nil, speaker_labels: nil, speakers_expected: nil, content_safety: nil, content_safety_confidence: nil, iab_categories: nil, custom_spelling: nil, sentiment_analysis: nil, auto_chapters: nil, entity_detection: nil, speech_threshold: nil, summarization: nil, summary_model: nil, summary_type: nil, custom_topics: nil, topics: nil, request_options: nil, polling_options: Transcripts::PollingOptions.new)
150
230
  Async do
151
231
  transcript = submit(audio_url: audio_url, speech_model: speech_model, language_code: language_code, punctuate: punctuate, format_text: format_text, dual_channel: dual_channel,
152
- 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, request_options: request_options).wait
232
+ 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, language_confidence_threshold: language_confidence_threshold, custom_spelling: custom_spelling, disfluencies: disfluencies, multichannel: multichannel, 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, request_options: request_options)
153
233
  wait_until_ready(transcript_id: transcript.id, polling_options: polling_options).wait
154
234
  end
155
235
  end
@@ -15,7 +15,7 @@ module AssemblyAI
15
15
  # @return [AssemblyAI::Transcripts::AudioIntelligenceModelStatus] The status of the Content Moderation model. Either success, or unavailable in
16
16
  # the rare case that the model failed.
17
17
  attr_reader :status
18
- # @return [Array<AssemblyAI::Transcripts::ContentSafetyLabelResult>]
18
+ # @return [Array<AssemblyAI::Transcripts::ContentSafetyLabelResult>] An array of results for the Content Moderation model
19
19
  attr_reader :results
20
20
  # @return [Hash{String => Float}] A summary of the Content Moderation confidence results for the entire audio file
21
21
  attr_reader :summary
@@ -31,7 +31,7 @@ module AssemblyAI
31
31
 
32
32
  # @param status [AssemblyAI::Transcripts::AudioIntelligenceModelStatus] The status of the Content Moderation model. Either success, or unavailable in
33
33
  # the rare case that the model failed.
34
- # @param results [Array<AssemblyAI::Transcripts::ContentSafetyLabelResult>]
34
+ # @param results [Array<AssemblyAI::Transcripts::ContentSafetyLabelResult>] An array of results for the Content Moderation model
35
35
  # @param summary [Hash{String => Float}] A summary of the Content Moderation confidence results for the entire audio file
36
36
  # @param severity_score_summary [Hash{String => AssemblyAI::Transcripts::SeverityScoreSummary}] A summary of the Content Moderation severity results for the entire audio file
37
37
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
@@ -7,13 +7,13 @@ require "json"
7
7
  module AssemblyAI
8
8
  class Transcripts
9
9
  class ParagraphsResponse
10
- # @return [String]
10
+ # @return [String] The unique identifier of your transcript
11
11
  attr_reader :id
12
- # @return [Float]
12
+ # @return [Float] The confidence score for the transcript
13
13
  attr_reader :confidence
14
- # @return [Float]
14
+ # @return [Float] The duration of the audio file in seconds
15
15
  attr_reader :audio_duration
16
- # @return [Array<AssemblyAI::Transcripts::TranscriptParagraph>]
16
+ # @return [Array<AssemblyAI::Transcripts::TranscriptParagraph>] An array of paragraphs in the transcript
17
17
  attr_reader :paragraphs
18
18
  # @return [OpenStruct] Additional properties unmapped to the current class definition
19
19
  attr_reader :additional_properties
@@ -23,10 +23,10 @@ module AssemblyAI
23
23
 
24
24
  OMIT = Object.new
25
25
 
26
- # @param id [String]
27
- # @param confidence [Float]
28
- # @param audio_duration [Float]
29
- # @param paragraphs [Array<AssemblyAI::Transcripts::TranscriptParagraph>]
26
+ # @param id [String] The unique identifier of your transcript
27
+ # @param confidence [Float] The confidence score for the transcript
28
+ # @param audio_duration [Float] The duration of the audio file in seconds
29
+ # @param paragraphs [Array<AssemblyAI::Transcripts::TranscriptParagraph>] An array of paragraphs in the transcript
30
30
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
31
  # @return [AssemblyAI::Transcripts::ParagraphsResponse]
32
32
  def initialize(id:, confidence:, audio_duration:, paragraphs:, additional_properties: nil)
@@ -7,13 +7,13 @@ require "json"
7
7
  module AssemblyAI
8
8
  class Transcripts
9
9
  class SentencesResponse
10
- # @return [String]
10
+ # @return [String] The unique identifier for the transcript
11
11
  attr_reader :id
12
- # @return [Float]
12
+ # @return [Float] The confidence score for the transcript
13
13
  attr_reader :confidence
14
- # @return [Float]
14
+ # @return [Float] The duration of the audio file in seconds
15
15
  attr_reader :audio_duration
16
- # @return [Array<AssemblyAI::Transcripts::TranscriptSentence>]
16
+ # @return [Array<AssemblyAI::Transcripts::TranscriptSentence>] An array of sentences in the transcript
17
17
  attr_reader :sentences
18
18
  # @return [OpenStruct] Additional properties unmapped to the current class definition
19
19
  attr_reader :additional_properties
@@ -23,10 +23,10 @@ module AssemblyAI
23
23
 
24
24
  OMIT = Object.new
25
25
 
26
- # @param id [String]
27
- # @param confidence [Float]
28
- # @param audio_duration [Float]
29
- # @param sentences [Array<AssemblyAI::Transcripts::TranscriptSentence>]
26
+ # @param id [String] The unique identifier for the transcript
27
+ # @param confidence [Float] The confidence score for the transcript
28
+ # @param audio_duration [Float] The duration of the audio file in seconds
29
+ # @param sentences [Array<AssemblyAI::Transcripts::TranscriptSentence>] An array of sentences in the transcript
30
30
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
31
31
  # @return [AssemblyAI::Transcripts::SentencesResponse]
32
32
  def initialize(id:, confidence:, audio_duration:, sentences:, additional_properties: nil)
@@ -18,6 +18,9 @@ module AssemblyAI
18
18
  attr_reader :sentiment
19
19
  # @return [Float] The confidence score for the detected sentiment of the sentence, from 0 to 1
20
20
  attr_reader :confidence
21
+ # @return [String] The channel of this utterance. The left and right channels are channels 1 and 2.
22
+ # Additional channels increment the channel number sequentially.
23
+ attr_reader :channel
21
24
  # @return [String] The speaker of the sentence if [Speaker
22
25
  # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
23
26
  # enabled, else null
@@ -35,17 +38,21 @@ module AssemblyAI
35
38
  # @param end_ [Integer] The ending time, in milliseconds, of the sentence
36
39
  # @param sentiment [AssemblyAI::Transcripts::Sentiment] The detected sentiment for the sentence, one of POSITIVE, NEUTRAL, NEGATIVE
37
40
  # @param confidence [Float] The confidence score for the detected sentiment of the sentence, from 0 to 1
41
+ # @param channel [String] The channel of this utterance. The left and right channels are channels 1 and 2.
42
+ # Additional channels increment the channel number sequentially.
38
43
  # @param speaker [String] The speaker of the sentence if [Speaker
39
44
  # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
40
45
  # enabled, else null
41
46
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
42
47
  # @return [AssemblyAI::Transcripts::SentimentAnalysisResult]
43
- def initialize(text:, start:, end_:, sentiment:, confidence:, speaker: OMIT, additional_properties: nil)
48
+ def initialize(text:, start:, end_:, sentiment:, confidence:, channel: OMIT, speaker: OMIT,
49
+ additional_properties: nil)
44
50
  @text = text
45
51
  @start = start
46
52
  @end_ = end_
47
53
  @sentiment = sentiment
48
54
  @confidence = confidence
55
+ @channel = channel if channel != OMIT
49
56
  @speaker = speaker if speaker != OMIT
50
57
  @additional_properties = additional_properties
51
58
  @_field_set = {
@@ -54,6 +61,7 @@ module AssemblyAI
54
61
  "end": end_,
55
62
  "sentiment": sentiment,
56
63
  "confidence": confidence,
64
+ "channel": channel,
57
65
  "speaker": speaker
58
66
  }.reject do |_k, v|
59
67
  v == OMIT
@@ -71,6 +79,7 @@ module AssemblyAI
71
79
  end_ = struct["end"]
72
80
  sentiment = struct["sentiment"]
73
81
  confidence = struct["confidence"]
82
+ channel = struct["channel"]
74
83
  speaker = struct["speaker"]
75
84
  new(
76
85
  text: text,
@@ -78,6 +87,7 @@ module AssemblyAI
78
87
  end_: end_,
79
88
  sentiment: sentiment,
80
89
  confidence: confidence,
90
+ channel: channel,
81
91
  speaker: speaker,
82
92
  additional_properties: struct
83
93
  )
@@ -102,6 +112,7 @@ module AssemblyAI
102
112
  obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
103
113
  obj.sentiment.is_a?(AssemblyAI::Transcripts::Sentiment) != false || raise("Passed value for field obj.sentiment is not the expected type, validation failed.")
104
114
  obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
115
+ obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.")
105
116
  obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.")
106
117
  end
107
118
  end
@@ -11,7 +11,7 @@ module AssemblyAI
11
11
  class TopicDetectionResult
12
12
  # @return [String] The text in the transcript in which a detected topic occurs
13
13
  attr_reader :text
14
- # @return [Array<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>]
14
+ # @return [Array<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>] An array of detected topics in the text
15
15
  attr_reader :labels
16
16
  # @return [AssemblyAI::Transcripts::Timestamp]
17
17
  attr_reader :timestamp
@@ -24,7 +24,7 @@ module AssemblyAI
24
24
  OMIT = Object.new
25
25
 
26
26
  # @param text [String] The text in the transcript in which a detected topic occurs
27
- # @param labels [Array<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>]
27
+ # @param labels [Array<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>] An array of detected topics in the text
28
28
  # @param timestamp [AssemblyAI::Transcripts::Timestamp]
29
29
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
30
  # @return [AssemblyAI::Transcripts::TopicDetectionResult]
@@ -40,7 +40,6 @@ module AssemblyAI
40
40
  attr_reader :language_detection
41
41
  # @return [Float] The confidence threshold for the automatically detected language.
42
42
  # An error will be returned if the language confidence is below this threshold.
43
- # Defaults to 0.
44
43
  attr_reader :language_confidence_threshold
45
44
  # @return [Float] The confidence score for the detected language, between 0.0 (low confidence) and
46
45
  # 1.0 (high confidence)
@@ -72,6 +71,13 @@ module AssemblyAI
72
71
  attr_reader :format_text
73
72
  # @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
74
73
  attr_reader :disfluencies
74
+ # @return [Boolean] Whether [Multichannel
75
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
76
+ # was enabled in the transcription request, either true or false
77
+ attr_reader :multichannel
78
+ # @return [Integer] The number of audio channels in the audio file. This is only present when
79
+ # multichannel is enabled.
80
+ attr_reader :audio_channels
75
81
  # @return [Boolean] Whether [Dual channel
76
82
  # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
77
83
  # was enabled in the transcription request, either true or false
@@ -224,7 +230,6 @@ module AssemblyAI
224
230
  # is enabled, either true or false
225
231
  # @param language_confidence_threshold [Float] The confidence threshold for the automatically detected language.
226
232
  # An error will be returned if the language confidence is below this threshold.
227
- # Defaults to 0.
228
233
  # @param language_confidence [Float] The confidence score for the detected language, between 0.0 (low confidence) and
229
234
  # 1.0 (high confidence)
230
235
  # @param speech_model [AssemblyAI::Transcripts::SpeechModel]
@@ -245,6 +250,11 @@ module AssemblyAI
245
250
  # @param punctuate [Boolean] Whether Automatic Punctuation is enabled, either true or false
246
251
  # @param format_text [Boolean] Whether Text Formatting is enabled, either true or false
247
252
  # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
253
+ # @param multichannel [Boolean] Whether [Multichannel
254
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
255
+ # was enabled in the transcription request, either true or false
256
+ # @param audio_channels [Integer] The number of audio channels in the audio file. This is only present when
257
+ # multichannel is enabled.
248
258
  # @param dual_channel [Boolean] Whether [Dual channel
249
259
  # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
250
260
  # was enabled in the transcription request, either true or false
@@ -337,7 +347,7 @@ module AssemblyAI
337
347
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
338
348
  # @return [AssemblyAI::Transcripts::Transcript]
339
349
  def initialize(id:, audio_url:, status:, webhook_auth:, auto_highlights:, redact_pii:, summarization:, language_model:, acoustic_model:, language_code: OMIT, language_detection: OMIT,
340
- language_confidence_threshold: OMIT, language_confidence: OMIT, speech_model: OMIT, text: OMIT, words: OMIT, utterances: OMIT, confidence: OMIT, audio_duration: OMIT, punctuate: OMIT, format_text: OMIT, disfluencies: OMIT, dual_channel: OMIT, webhook_url: OMIT, webhook_status_code: OMIT, webhook_auth_header_name: OMIT, speed_boost: OMIT, auto_highlights_result: OMIT, audio_start_from: OMIT, audio_end_at: OMIT, word_boost: OMIT, boost_param: OMIT, filter_profanity: OMIT, redact_pii_audio: OMIT, redact_pii_audio_quality: OMIT, redact_pii_policies: OMIT, redact_pii_sub: OMIT, speaker_labels: OMIT, speakers_expected: OMIT, content_safety: OMIT, content_safety_labels: OMIT, iab_categories: OMIT, iab_categories_result: OMIT, custom_spelling: OMIT, auto_chapters: OMIT, chapters: OMIT, summary_type: OMIT, summary_model: OMIT, summary: OMIT, custom_topics: OMIT, topics: OMIT, sentiment_analysis: OMIT, sentiment_analysis_results: OMIT, entity_detection: OMIT, entities: OMIT, speech_threshold: OMIT, throttled: OMIT, error: OMIT, additional_properties: nil)
350
+ language_confidence_threshold: OMIT, language_confidence: OMIT, speech_model: OMIT, text: OMIT, words: OMIT, utterances: OMIT, confidence: OMIT, audio_duration: OMIT, punctuate: OMIT, format_text: OMIT, disfluencies: OMIT, multichannel: OMIT, audio_channels: OMIT, dual_channel: OMIT, webhook_url: OMIT, webhook_status_code: OMIT, webhook_auth_header_name: OMIT, speed_boost: OMIT, auto_highlights_result: OMIT, audio_start_from: OMIT, audio_end_at: OMIT, word_boost: OMIT, boost_param: OMIT, filter_profanity: OMIT, redact_pii_audio: OMIT, redact_pii_audio_quality: OMIT, redact_pii_policies: OMIT, redact_pii_sub: OMIT, speaker_labels: OMIT, speakers_expected: OMIT, content_safety: OMIT, content_safety_labels: OMIT, iab_categories: OMIT, iab_categories_result: OMIT, custom_spelling: OMIT, auto_chapters: OMIT, chapters: OMIT, summary_type: OMIT, summary_model: OMIT, summary: OMIT, custom_topics: OMIT, topics: OMIT, sentiment_analysis: OMIT, sentiment_analysis_results: OMIT, entity_detection: OMIT, entities: OMIT, speech_threshold: OMIT, throttled: OMIT, error: OMIT, additional_properties: nil)
341
351
  @id = id
342
352
  @audio_url = audio_url
343
353
  @status = status
@@ -354,6 +364,8 @@ module AssemblyAI
354
364
  @punctuate = punctuate if punctuate != OMIT
355
365
  @format_text = format_text if format_text != OMIT
356
366
  @disfluencies = disfluencies if disfluencies != OMIT
367
+ @multichannel = multichannel if multichannel != OMIT
368
+ @audio_channels = audio_channels if audio_channels != OMIT
357
369
  @dual_channel = dual_channel if dual_channel != OMIT
358
370
  @webhook_url = webhook_url if webhook_url != OMIT
359
371
  @webhook_status_code = webhook_status_code if webhook_status_code != OMIT
@@ -414,6 +426,8 @@ module AssemblyAI
414
426
  "punctuate": punctuate,
415
427
  "format_text": format_text,
416
428
  "disfluencies": disfluencies,
429
+ "multichannel": multichannel,
430
+ "audio_channels": audio_channels,
417
431
  "dual_channel": dual_channel,
418
432
  "webhook_url": webhook_url,
419
433
  "webhook_status_code": webhook_status_code,
@@ -490,6 +504,8 @@ module AssemblyAI
490
504
  punctuate = struct["punctuate"]
491
505
  format_text = struct["format_text"]
492
506
  disfluencies = struct["disfluencies"]
507
+ multichannel = struct["multichannel"]
508
+ audio_channels = struct["audio_channels"]
493
509
  dual_channel = struct["dual_channel"]
494
510
  webhook_url = struct["webhook_url"]
495
511
  webhook_status_code = struct["webhook_status_code"]
@@ -576,6 +592,8 @@ module AssemblyAI
576
592
  punctuate: punctuate,
577
593
  format_text: format_text,
578
594
  disfluencies: disfluencies,
595
+ multichannel: multichannel,
596
+ audio_channels: audio_channels,
579
597
  dual_channel: dual_channel,
580
598
  webhook_url: webhook_url,
581
599
  webhook_status_code: webhook_status_code,
@@ -652,6 +670,8 @@ module AssemblyAI
652
670
  obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.")
653
671
  obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.")
654
672
  obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
673
+ obj.multichannel&.is_a?(Boolean) != false || raise("Passed value for field obj.multichannel is not the expected type, validation failed.")
674
+ obj.audio_channels&.is_a?(Integer) != false || raise("Passed value for field obj.audio_channels is not the expected type, validation failed.")
655
675
  obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.")
656
676
  obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.")
657
677
  obj.webhook_status_code&.is_a?(Integer) != false || raise("Passed value for field obj.webhook_status_code is not the expected type, validation failed.")
@@ -10,9 +10,9 @@ module AssemblyAI
10
10
  # A list of transcripts. Transcripts are sorted from newest to oldest. The
11
11
  # previous URL always points to a page with older transcripts.
12
12
  class TranscriptList
13
- # @return [AssemblyAI::Transcripts::PageDetails]
13
+ # @return [AssemblyAI::Transcripts::PageDetails] Details of the transcript page
14
14
  attr_reader :page_details
15
- # @return [Array<AssemblyAI::Transcripts::TranscriptListItem>]
15
+ # @return [Array<AssemblyAI::Transcripts::TranscriptListItem>] An array of transcripts
16
16
  attr_reader :transcripts
17
17
  # @return [OpenStruct] Additional properties unmapped to the current class definition
18
18
  attr_reader :additional_properties
@@ -22,8 +22,8 @@ module AssemblyAI
22
22
 
23
23
  OMIT = Object.new
24
24
 
25
- # @param page_details [AssemblyAI::Transcripts::PageDetails]
26
- # @param transcripts [Array<AssemblyAI::Transcripts::TranscriptListItem>]
25
+ # @param page_details [AssemblyAI::Transcripts::PageDetails] Details of the transcript page
26
+ # @param transcripts [Array<AssemblyAI::Transcripts::TranscriptListItem>] An array of transcripts
27
27
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
28
28
  # @return [AssemblyAI::Transcripts::TranscriptList]
29
29
  def initialize(page_details:, transcripts:, additional_properties: nil)
@@ -8,17 +8,17 @@ require "json"
8
8
  module AssemblyAI
9
9
  class Transcripts
10
10
  class TranscriptListItem
11
- # @return [String]
11
+ # @return [String] The unique identifier for the transcript
12
12
  attr_reader :id
13
- # @return [String]
13
+ # @return [String] The URL to retrieve the transcript
14
14
  attr_reader :resource_url
15
- # @return [AssemblyAI::Transcripts::TranscriptStatus]
15
+ # @return [AssemblyAI::Transcripts::TranscriptStatus] The status of the transcript
16
16
  attr_reader :status
17
- # @return [DateTime]
17
+ # @return [DateTime] The date and time the transcript was created
18
18
  attr_reader :created
19
- # @return [DateTime]
19
+ # @return [DateTime] The date and time the transcript was completed
20
20
  attr_reader :completed
21
- # @return [String]
21
+ # @return [String] The URL to the audio file
22
22
  attr_reader :audio_url
23
23
  # @return [String] Error message of why the transcript failed
24
24
  attr_reader :error
@@ -30,12 +30,12 @@ module AssemblyAI
30
30
 
31
31
  OMIT = Object.new
32
32
 
33
- # @param id [String]
34
- # @param resource_url [String]
35
- # @param status [AssemblyAI::Transcripts::TranscriptStatus]
36
- # @param created [DateTime]
37
- # @param completed [DateTime]
38
- # @param audio_url [String]
33
+ # @param id [String] The unique identifier for the transcript
34
+ # @param resource_url [String] The URL to retrieve the transcript
35
+ # @param status [AssemblyAI::Transcripts::TranscriptStatus] The status of the transcript
36
+ # @param created [DateTime] The date and time the transcript was created
37
+ # @param completed [DateTime] The date and time the transcript was completed
38
+ # @param audio_url [String] The URL to the audio file
39
39
  # @param error [String] Error message of why the transcript failed
40
40
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
41
41
  # @return [AssemblyAI::Transcripts::TranscriptListItem]
@@ -34,13 +34,18 @@ module AssemblyAI
34
34
  attr_reader :format_text
35
35
  # @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
36
36
  attr_reader :disfluencies
37
+ # @return [Boolean] Enable
38
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
39
+ # transcription, can be true or false.
40
+ attr_reader :multichannel
37
41
  # @return [Boolean] Enable [Dual
38
42
  # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
39
43
  # transcription, can be true or false.
40
44
  attr_reader :dual_channel
41
- # @return [String] The URL to which we send webhook requests. We sends two different types of
42
- # webhook requests. One request when a transcript is completed or failed, and one
43
- # request when the redacted audio is ready if redact_pii_audio is enabled.
45
+ # @return [String] The URL to which we send webhook requests.
46
+ # We sends two different types of webhook requests.
47
+ # One request when a transcript is completed or failed, and one request when the
48
+ # redacted audio is ready if redact_pii_audio is enabled.
44
49
  attr_reader :webhook_url
45
50
  # @return [String] The header name to be sent with the transcript completed or failed webhook
46
51
  # requests
@@ -145,12 +150,16 @@ module AssemblyAI
145
150
  # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
146
151
  # @param format_text [Boolean] Enable Text Formatting, can be true or false
147
152
  # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
153
+ # @param multichannel [Boolean] Enable
154
+ # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription)
155
+ # transcription, can be true or false.
148
156
  # @param dual_channel [Boolean] Enable [Dual
149
157
  # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
150
158
  # transcription, can be true or false.
151
- # @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of
152
- # webhook requests. One request when a transcript is completed or failed, and one
153
- # request when the redacted audio is ready if redact_pii_audio is enabled.
159
+ # @param webhook_url [String] The URL to which we send webhook requests.
160
+ # We sends two different types of webhook requests.
161
+ # One request when a transcript is completed or failed, and one request when the
162
+ # redacted audio is ready if redact_pii_audio is enabled.
154
163
  # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook
155
164
  # requests
156
165
  # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook
@@ -210,7 +219,7 @@ module AssemblyAI
210
219
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
211
220
  # @return [AssemblyAI::Transcripts::TranscriptOptionalParams]
212
221
  def initialize(language_code: OMIT, language_detection: OMIT, language_confidence_threshold: OMIT,
213
- speech_model: OMIT, punctuate: OMIT, format_text: OMIT, disfluencies: 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)
222
+ 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)
214
223
  @language_code = language_code if language_code != OMIT
215
224
  @language_detection = language_detection if language_detection != OMIT
216
225
  @language_confidence_threshold = language_confidence_threshold if language_confidence_threshold != OMIT
@@ -218,6 +227,7 @@ module AssemblyAI
218
227
  @punctuate = punctuate if punctuate != OMIT
219
228
  @format_text = format_text if format_text != OMIT
220
229
  @disfluencies = disfluencies if disfluencies != OMIT
230
+ @multichannel = multichannel if multichannel != OMIT
221
231
  @dual_channel = dual_channel if dual_channel != OMIT
222
232
  @webhook_url = webhook_url if webhook_url != OMIT
223
233
  @webhook_auth_header_name = webhook_auth_header_name if webhook_auth_header_name != OMIT
@@ -257,6 +267,7 @@ module AssemblyAI
257
267
  "punctuate": punctuate,
258
268
  "format_text": format_text,
259
269
  "disfluencies": disfluencies,
270
+ "multichannel": multichannel,
260
271
  "dual_channel": dual_channel,
261
272
  "webhook_url": webhook_url,
262
273
  "webhook_auth_header_name": webhook_auth_header_name,
@@ -306,6 +317,7 @@ module AssemblyAI
306
317
  punctuate = struct["punctuate"]
307
318
  format_text = struct["format_text"]
308
319
  disfluencies = struct["disfluencies"]
320
+ multichannel = struct["multichannel"]
309
321
  dual_channel = struct["dual_channel"]
310
322
  webhook_url = struct["webhook_url"]
311
323
  webhook_auth_header_name = struct["webhook_auth_header_name"]
@@ -347,6 +359,7 @@ module AssemblyAI
347
359
  punctuate: punctuate,
348
360
  format_text: format_text,
349
361
  disfluencies: disfluencies,
362
+ multichannel: multichannel,
350
363
  dual_channel: dual_channel,
351
364
  webhook_url: webhook_url,
352
365
  webhook_auth_header_name: webhook_auth_header_name,
@@ -402,6 +415,7 @@ module AssemblyAI
402
415
  obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.")
403
416
  obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.")
404
417
  obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
418
+ obj.multichannel&.is_a?(Boolean) != false || raise("Passed value for field obj.multichannel is not the expected type, validation failed.")
405
419
  obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.")
406
420
  obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.")
407
421
  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.")
@@ -7,20 +7,16 @@ require "json"
7
7
  module AssemblyAI
8
8
  class Transcripts
9
9
  class TranscriptParagraph
10
- # @return [String]
10
+ # @return [String] The transcript of the paragraph
11
11
  attr_reader :text
12
- # @return [Integer]
12
+ # @return [Integer] The starting time, in milliseconds, of the paragraph
13
13
  attr_reader :start
14
- # @return [Integer]
14
+ # @return [Integer] The ending time, in milliseconds, of the paragraph
15
15
  attr_reader :end_
16
- # @return [Float]
16
+ # @return [Float] The confidence score for the transcript of this paragraph
17
17
  attr_reader :confidence
18
- # @return [Array<AssemblyAI::Transcripts::TranscriptWord>]
18
+ # @return [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of words in the paragraph
19
19
  attr_reader :words
20
- # @return [String] The speaker of the sentence if [Speaker
21
- # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
22
- # enabled, else null
23
- attr_reader :speaker
24
20
  # @return [OpenStruct] Additional properties unmapped to the current class definition
25
21
  attr_reader :additional_properties
26
22
  # @return [Object]
@@ -29,34 +25,21 @@ module AssemblyAI
29
25
 
30
26
  OMIT = Object.new
31
27
 
32
- # @param text [String]
33
- # @param start [Integer]
34
- # @param end_ [Integer]
35
- # @param confidence [Float]
36
- # @param words [Array<AssemblyAI::Transcripts::TranscriptWord>]
37
- # @param speaker [String] The speaker of the sentence if [Speaker
38
- # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
39
- # enabled, else null
28
+ # @param text [String] The transcript of the paragraph
29
+ # @param start [Integer] The starting time, in milliseconds, of the paragraph
30
+ # @param end_ [Integer] The ending time, in milliseconds, of the paragraph
31
+ # @param confidence [Float] The confidence score for the transcript of this paragraph
32
+ # @param words [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of words in the paragraph
40
33
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
41
34
  # @return [AssemblyAI::Transcripts::TranscriptParagraph]
42
- def initialize(text:, start:, end_:, confidence:, words:, speaker: OMIT, additional_properties: nil)
35
+ def initialize(text:, start:, end_:, confidence:, words:, additional_properties: nil)
43
36
  @text = text
44
37
  @start = start
45
38
  @end_ = end_
46
39
  @confidence = confidence
47
40
  @words = words
48
- @speaker = speaker if speaker != OMIT
49
41
  @additional_properties = additional_properties
50
- @_field_set = {
51
- "text": text,
52
- "start": start,
53
- "end": end_,
54
- "confidence": confidence,
55
- "words": words,
56
- "speaker": speaker
57
- }.reject do |_k, v|
58
- v == OMIT
59
- end
42
+ @_field_set = { "text": text, "start": start, "end": end_, "confidence": confidence, "words": words }
60
43
  end
61
44
 
62
45
  # Deserialize a JSON object to an instance of TranscriptParagraph
@@ -74,14 +57,12 @@ module AssemblyAI
74
57
  v = v.to_json
75
58
  AssemblyAI::Transcripts::TranscriptWord.from_json(json_object: v)
76
59
  end
77
- speaker = struct["speaker"]
78
60
  new(
79
61
  text: text,
80
62
  start: start,
81
63
  end_: end_,
82
64
  confidence: confidence,
83
65
  words: words,
84
- speaker: speaker,
85
66
  additional_properties: struct
86
67
  )
87
68
  end
@@ -105,7 +86,6 @@ module AssemblyAI
105
86
  obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
106
87
  obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
107
88
  obj.words.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
108
- obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.")
109
89
  end
110
90
  end
111
91
  end
@@ -7,16 +7,19 @@ require "json"
7
7
  module AssemblyAI
8
8
  class Transcripts
9
9
  class TranscriptSentence
10
- # @return [String]
10
+ # @return [String] The transcript of the sentence
11
11
  attr_reader :text
12
- # @return [Integer]
12
+ # @return [Integer] The starting time, in milliseconds, for the sentence
13
13
  attr_reader :start
14
- # @return [Integer]
14
+ # @return [Integer] The ending time, in milliseconds, for the sentence
15
15
  attr_reader :end_
16
- # @return [Float]
16
+ # @return [Float] The confidence score for the transcript of this sentence
17
17
  attr_reader :confidence
18
- # @return [Array<AssemblyAI::Transcripts::TranscriptWord>]
18
+ # @return [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of words in the sentence
19
19
  attr_reader :words
20
+ # @return [String] The channel of the sentence. The left and right channels are channels 1 and 2.
21
+ # Additional channels increment the channel number sequentially.
22
+ attr_reader :channel
20
23
  # @return [String] The speaker of the sentence if [Speaker
21
24
  # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
22
25
  # enabled, else null
@@ -29,22 +32,26 @@ module AssemblyAI
29
32
 
30
33
  OMIT = Object.new
31
34
 
32
- # @param text [String]
33
- # @param start [Integer]
34
- # @param end_ [Integer]
35
- # @param confidence [Float]
36
- # @param words [Array<AssemblyAI::Transcripts::TranscriptWord>]
35
+ # @param text [String] The transcript of the sentence
36
+ # @param start [Integer] The starting time, in milliseconds, for the sentence
37
+ # @param end_ [Integer] The ending time, in milliseconds, for the sentence
38
+ # @param confidence [Float] The confidence score for the transcript of this sentence
39
+ # @param words [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of words in the sentence
40
+ # @param channel [String] The channel of the sentence. The left and right channels are channels 1 and 2.
41
+ # Additional channels increment the channel number sequentially.
37
42
  # @param speaker [String] The speaker of the sentence if [Speaker
38
43
  # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
39
44
  # enabled, else null
40
45
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
41
46
  # @return [AssemblyAI::Transcripts::TranscriptSentence]
42
- def initialize(text:, start:, end_:, confidence:, words:, speaker: OMIT, additional_properties: nil)
47
+ def initialize(text:, start:, end_:, confidence:, words:, channel: OMIT, speaker: OMIT,
48
+ additional_properties: nil)
43
49
  @text = text
44
50
  @start = start
45
51
  @end_ = end_
46
52
  @confidence = confidence
47
53
  @words = words
54
+ @channel = channel if channel != OMIT
48
55
  @speaker = speaker if speaker != OMIT
49
56
  @additional_properties = additional_properties
50
57
  @_field_set = {
@@ -53,6 +60,7 @@ module AssemblyAI
53
60
  "end": end_,
54
61
  "confidence": confidence,
55
62
  "words": words,
63
+ "channel": channel,
56
64
  "speaker": speaker
57
65
  }.reject do |_k, v|
58
66
  v == OMIT
@@ -74,6 +82,7 @@ module AssemblyAI
74
82
  v = v.to_json
75
83
  AssemblyAI::Transcripts::TranscriptWord.from_json(json_object: v)
76
84
  end
85
+ channel = struct["channel"]
77
86
  speaker = struct["speaker"]
78
87
  new(
79
88
  text: text,
@@ -81,6 +90,7 @@ module AssemblyAI
81
90
  end_: end_,
82
91
  confidence: confidence,
83
92
  words: words,
93
+ channel: channel,
84
94
  speaker: speaker,
85
95
  additional_properties: struct
86
96
  )
@@ -105,6 +115,7 @@ module AssemblyAI
105
115
  obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
106
116
  obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.")
107
117
  obj.words.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
118
+ obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.")
108
119
  obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.")
109
120
  end
110
121
  end
@@ -17,6 +17,9 @@ module AssemblyAI
17
17
  attr_reader :text
18
18
  # @return [Array<AssemblyAI::Transcripts::TranscriptWord>] The words in the utterance.
19
19
  attr_reader :words
20
+ # @return [String] The channel of this utterance. The left and right channels are channels 1 and 2.
21
+ # Additional channels increment the channel number sequentially.
22
+ attr_reader :channel
20
23
  # @return [String] The speaker of this utterance, where each speaker is assigned a sequential
21
24
  # capital letter - e.g. "A" for Speaker A, "B" for Speaker B, etc.
22
25
  attr_reader :speaker
@@ -33,16 +36,19 @@ module AssemblyAI
33
36
  # @param end_ [Integer] The ending time, in milliseconds, of the utterance in the audio file
34
37
  # @param text [String] The text for this utterance
35
38
  # @param words [Array<AssemblyAI::Transcripts::TranscriptWord>] The words in the utterance.
39
+ # @param channel [String] The channel of this utterance. The left and right channels are channels 1 and 2.
40
+ # Additional channels increment the channel number sequentially.
36
41
  # @param speaker [String] The speaker of this utterance, where each speaker is assigned a sequential
37
42
  # capital letter - e.g. "A" for Speaker A, "B" for Speaker B, etc.
38
43
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
39
44
  # @return [AssemblyAI::Transcripts::TranscriptUtterance]
40
- def initialize(confidence:, start:, end_:, text:, words:, speaker:, additional_properties: nil)
45
+ def initialize(confidence:, start:, end_:, text:, words:, speaker:, channel: OMIT, additional_properties: nil)
41
46
  @confidence = confidence
42
47
  @start = start
43
48
  @end_ = end_
44
49
  @text = text
45
50
  @words = words
51
+ @channel = channel if channel != OMIT
46
52
  @speaker = speaker
47
53
  @additional_properties = additional_properties
48
54
  @_field_set = {
@@ -51,8 +57,11 @@ module AssemblyAI
51
57
  "end": end_,
52
58
  "text": text,
53
59
  "words": words,
60
+ "channel": channel,
54
61
  "speaker": speaker
55
- }
62
+ }.reject do |_k, v|
63
+ v == OMIT
64
+ end
56
65
  end
57
66
 
58
67
  # Deserialize a JSON object to an instance of TranscriptUtterance
@@ -70,6 +79,7 @@ module AssemblyAI
70
79
  v = v.to_json
71
80
  AssemblyAI::Transcripts::TranscriptWord.from_json(json_object: v)
72
81
  end
82
+ channel = struct["channel"]
73
83
  speaker = struct["speaker"]
74
84
  new(
75
85
  confidence: confidence,
@@ -77,6 +87,7 @@ module AssemblyAI
77
87
  end_: end_,
78
88
  text: text,
79
89
  words: words,
90
+ channel: channel,
80
91
  speaker: speaker,
81
92
  additional_properties: struct
82
93
  )
@@ -101,6 +112,7 @@ module AssemblyAI
101
112
  obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
102
113
  obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
103
114
  obj.words.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
115
+ obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.")
104
116
  obj.speaker.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.")
105
117
  end
106
118
  end
@@ -6,15 +6,18 @@ require "json"
6
6
  module AssemblyAI
7
7
  class Transcripts
8
8
  class TranscriptWord
9
- # @return [Float]
9
+ # @return [Float] The confidence score for the transcript of this word
10
10
  attr_reader :confidence
11
- # @return [Integer]
11
+ # @return [Integer] The starting time, in milliseconds, for the word
12
12
  attr_reader :start
13
- # @return [Integer]
13
+ # @return [Integer] The ending time, in milliseconds, for the word
14
14
  attr_reader :end_
15
- # @return [String]
15
+ # @return [String] The text of the word
16
16
  attr_reader :text
17
- # @return [String] The speaker of the sentence if [Speaker
17
+ # @return [String] The channel of the word. The left and right channels are channels 1 and 2.
18
+ # Additional channels increment the channel number sequentially.
19
+ attr_reader :channel
20
+ # @return [String] The speaker of the word if [Speaker
18
21
  # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
19
22
  # enabled, else null
20
23
  attr_reader :speaker
@@ -26,20 +29,23 @@ module AssemblyAI
26
29
 
27
30
  OMIT = Object.new
28
31
 
29
- # @param confidence [Float]
30
- # @param start [Integer]
31
- # @param end_ [Integer]
32
- # @param text [String]
33
- # @param speaker [String] The speaker of the sentence if [Speaker
32
+ # @param confidence [Float] The confidence score for the transcript of this word
33
+ # @param start [Integer] The starting time, in milliseconds, for the word
34
+ # @param end_ [Integer] The ending time, in milliseconds, for the word
35
+ # @param text [String] The text of the word
36
+ # @param channel [String] The channel of the word. The left and right channels are channels 1 and 2.
37
+ # Additional channels increment the channel number sequentially.
38
+ # @param speaker [String] The speaker of the word if [Speaker
34
39
  # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is
35
40
  # enabled, else null
36
41
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
37
42
  # @return [AssemblyAI::Transcripts::TranscriptWord]
38
- def initialize(confidence:, start:, end_:, text:, speaker: OMIT, additional_properties: nil)
43
+ def initialize(confidence:, start:, end_:, text:, channel: OMIT, speaker: OMIT, additional_properties: nil)
39
44
  @confidence = confidence
40
45
  @start = start
41
46
  @end_ = end_
42
47
  @text = text
48
+ @channel = channel if channel != OMIT
43
49
  @speaker = speaker if speaker != OMIT
44
50
  @additional_properties = additional_properties
45
51
  @_field_set = {
@@ -47,6 +53,7 @@ module AssemblyAI
47
53
  "start": start,
48
54
  "end": end_,
49
55
  "text": text,
56
+ "channel": channel,
50
57
  "speaker": speaker
51
58
  }.reject do |_k, v|
52
59
  v == OMIT
@@ -63,12 +70,14 @@ module AssemblyAI
63
70
  start = struct["start"]
64
71
  end_ = struct["end"]
65
72
  text = struct["text"]
73
+ channel = struct["channel"]
66
74
  speaker = struct["speaker"]
67
75
  new(
68
76
  confidence: confidence,
69
77
  start: start,
70
78
  end_: end_,
71
79
  text: text,
80
+ channel: channel,
72
81
  speaker: speaker,
73
82
  additional_properties: struct
74
83
  )
@@ -92,6 +101,7 @@ module AssemblyAI
92
101
  obj.start.is_a?(Integer) != false || raise("Passed value for field obj.start is not the expected type, validation failed.")
93
102
  obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.")
94
103
  obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
104
+ obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.")
95
105
  obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.")
96
106
  end
97
107
  end
data/lib/gemconfig.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  module AssemblyAI
4
4
  module Gemconfig
5
- VERSION = "1.1.0"
5
+ VERSION = "1.2.0"
6
6
  AUTHORS = ["AssemblyAI"].freeze
7
7
  EMAIL = "support@assemblyai.com"
8
8
  SUMMARY = "AssemblyAI Ruby SDK"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assemblyai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AssemblyAI
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-26 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http-faraday