assemblyai 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/assemblyai/transcripts/client.rb +341 -155
- data/lib/assemblyai/transcripts/polling_client.rb +6 -8
- data/lib/assemblyai/transcripts/types/transcript.rb +78 -56
- data/lib/assemblyai/transcripts/types/transcript_boost_param.rb +1 -1
- data/lib/assemblyai/transcripts/types/transcript_list_item.rb +3 -3
- data/lib/assemblyai/transcripts/types/transcript_optional_params.rb +44 -32
- data/lib/gemconfig.rb +1 -1
- metadata +2 -2
@@ -31,7 +31,7 @@ module AssemblyAI
|
|
31
31
|
# @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
|
32
32
|
# @param format_text [Boolean] Enable Text Formatting, can be true or false
|
33
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
|
34
|
+
# @param webhook_url [String] The URL to which AssemblyAI send webhooks upon transcription completion
|
35
35
|
# @param webhook_auth_header_name [String] The header name which should be sent back with webhook calls
|
36
36
|
# @param webhook_auth_header_value [String] Specify a header name and value to send back with a webhook call for added security
|
37
37
|
# @param auto_highlights [Boolean] Whether Key Phrases is enabled, either true or false
|
@@ -65,15 +65,14 @@ module AssemblyAI
|
|
65
65
|
# @param summary_type [Transcripts::SummaryType] The type of summary
|
66
66
|
# @param custom_topics [Boolean] Whether custom topics is enabled, either true or false
|
67
67
|
# @param topics [Array<String>] The list of custom topics provided, if custom topics is enabled
|
68
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
69
68
|
# @param audio_url [String] The URL of the audio or video file to transcribe.
|
70
69
|
# @param request_options [RequestOptions]
|
71
70
|
# @param polling_options [Transcripts::PollingOptions] Configuration options for polling requests.
|
72
71
|
# @return [Transcripts::Transcript]
|
73
72
|
def transcribe(audio_url:, speech_model: nil, language_code: nil, punctuate: nil, format_text: nil, dual_channel: nil,
|
74
|
-
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,
|
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)
|
75
74
|
transcript = submit(audio_url: audio_url, speech_model: speech_model, language_code: language_code, punctuate: punctuate, format_text: format_text, dual_channel: dual_channel,
|
76
|
-
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,
|
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)
|
77
76
|
wait_until_ready(transcript_id: transcript.id, polling_options: polling_options)
|
78
77
|
end
|
79
78
|
|
@@ -108,7 +107,7 @@ module AssemblyAI
|
|
108
107
|
# @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
|
109
108
|
# @param format_text [Boolean] Enable Text Formatting, can be true or false
|
110
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.
|
111
|
-
# @param webhook_url [String] The URL to which AssemblyAI send webhooks upon
|
110
|
+
# @param webhook_url [String] The URL to which AssemblyAI send webhooks upon transcription completion
|
112
111
|
# @param webhook_auth_header_name [String] The header name which should be sent back with webhook calls
|
113
112
|
# @param webhook_auth_header_value [String] Specify a header name and value to send back with a webhook call for added security
|
114
113
|
# @param auto_highlights [Boolean] Whether Key Phrases is enabled, either true or false
|
@@ -142,16 +141,15 @@ module AssemblyAI
|
|
142
141
|
# @param summary_type [Transcripts::SummaryType] The type of summary
|
143
142
|
# @param custom_topics [Boolean] Whether custom topics is enabled, either true or false
|
144
143
|
# @param topics [Array<String>] The list of custom topics provided, if custom topics is enabled
|
145
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
146
144
|
# @param audio_url [String] The URL of the audio or video file to transcribe.
|
147
145
|
# @param request_options [RequestOptions]
|
148
146
|
# @param polling_options [Transcripts::PollingOptions] Configuration options for polling requests.
|
149
147
|
# @return [Transcripts::Transcript]
|
150
148
|
def transcribe(audio_url:, speech_model: nil, language_code: nil, punctuate: nil, format_text: nil, dual_channel: nil,
|
151
|
-
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,
|
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)
|
152
150
|
Async do
|
153
151
|
transcript = submit(audio_url: audio_url, speech_model: speech_model, language_code: language_code, punctuate: punctuate, format_text: format_text, dual_channel: dual_channel,
|
154
|
-
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,
|
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
|
155
153
|
wait_until_ready(transcript_id: transcript.id, polling_options: polling_options).wait
|
156
154
|
end
|
157
155
|
end
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require_relative "transcript_status"
|
4
4
|
require_relative "transcript_language_code"
|
5
|
+
require_relative "speech_model"
|
5
6
|
require_relative "transcript_word"
|
6
7
|
require_relative "transcript_utterance"
|
7
|
-
require_relative "speech_model"
|
8
8
|
require_relative "auto_highlights_result"
|
9
9
|
require_relative "redact_pii_audio_quality"
|
10
10
|
require_relative "pii_policy"
|
@@ -24,10 +24,8 @@ module AssemblyAI
|
|
24
24
|
class Transcript
|
25
25
|
# @return [String] The unique identifier of your transcript
|
26
26
|
attr_reader :id
|
27
|
-
# @return [String] The
|
28
|
-
attr_reader :
|
29
|
-
# @return [String] The acoustic model that was used for the transcript
|
30
|
-
attr_reader :acoustic_model
|
27
|
+
# @return [String] The URL of the media that was transcribed
|
28
|
+
attr_reader :audio_url
|
31
29
|
# @return [AssemblyAI::Transcripts::TranscriptStatus] The status of your transcript. Possible values are queued, processing,
|
32
30
|
# completed, or error.
|
33
31
|
attr_reader :status
|
@@ -36,8 +34,19 @@ module AssemblyAI
|
|
36
34
|
# Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
37
35
|
# The default value is 'en_us'.
|
38
36
|
attr_reader :language_code
|
39
|
-
# @return [
|
40
|
-
|
37
|
+
# @return [Boolean] Whether [Automatic language
|
38
|
+
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
39
|
+
# is enabled, either true or false
|
40
|
+
attr_reader :language_detection
|
41
|
+
# @return [Float] The confidence threshold for the automatically detected language.
|
42
|
+
# An error will be returned if the language confidence is below this threshold.
|
43
|
+
# Defaults to 0.
|
44
|
+
attr_reader :language_confidence_threshold
|
45
|
+
# @return [Float] The confidence score for the detected language, between 0.0 (low confidence) and
|
46
|
+
# 1.0 (high confidence)
|
47
|
+
attr_reader :language_confidence
|
48
|
+
# @return [AssemblyAI::Transcripts::SpeechModel]
|
49
|
+
attr_reader :speech_model
|
41
50
|
# @return [String] The textual transcript of your media file
|
42
51
|
attr_reader :text
|
43
52
|
# @return [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of temporally-sequential word objects, one for each word in the
|
@@ -61,12 +70,12 @@ module AssemblyAI
|
|
61
70
|
attr_reader :punctuate
|
62
71
|
# @return [Boolean] Whether Text Formatting is enabled, either true or false
|
63
72
|
attr_reader :format_text
|
73
|
+
# @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
74
|
+
attr_reader :disfluencies
|
64
75
|
# @return [Boolean] Whether [Dual channel
|
65
76
|
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
|
66
77
|
# was enabled in the transcription request, either true or false
|
67
78
|
attr_reader :dual_channel
|
68
|
-
# @return [AssemblyAI::Transcripts::SpeechModel]
|
69
|
-
attr_reader :speech_model
|
70
79
|
# @return [String] The URL to which we send webhook requests.
|
71
80
|
# We sends two different types of webhook requests.
|
72
81
|
# One request when a transcript is completed or failed, and one request when the
|
@@ -140,10 +149,6 @@ module AssemblyAI
|
|
140
149
|
attr_reader :iab_categories
|
141
150
|
# @return [AssemblyAI::Transcripts::TopicDetectionModelResult]
|
142
151
|
attr_reader :iab_categories_result
|
143
|
-
# @return [Boolean] Whether [Automatic language
|
144
|
-
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
145
|
-
# is enabled, either true or false
|
146
|
-
attr_reader :language_detection
|
147
152
|
# @return [Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>] Customize how words are spelled and formatted using to and from values
|
148
153
|
attr_reader :custom_spelling
|
149
154
|
# @return [Boolean] Whether [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters) is
|
@@ -168,8 +173,6 @@ module AssemblyAI
|
|
168
173
|
attr_reader :custom_topics
|
169
174
|
# @return [Array<String>] The list of custom topics provided if custom topics is enabled
|
170
175
|
attr_reader :topics
|
171
|
-
# @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
172
|
-
attr_reader :disfluencies
|
173
176
|
# @return [Boolean] Whether [Sentiment
|
174
177
|
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) is enabled,
|
175
178
|
# can be true or false
|
@@ -196,6 +199,10 @@ module AssemblyAI
|
|
196
199
|
attr_reader :throttled
|
197
200
|
# @return [String] Error message of why the transcript failed
|
198
201
|
attr_reader :error
|
202
|
+
# @return [String] The language model that was used for the transcript
|
203
|
+
attr_reader :language_model
|
204
|
+
# @return [String] The acoustic model that was used for the transcript
|
205
|
+
attr_reader :acoustic_model
|
199
206
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
200
207
|
attr_reader :additional_properties
|
201
208
|
# @return [Object]
|
@@ -205,15 +212,22 @@ module AssemblyAI
|
|
205
212
|
OMIT = Object.new
|
206
213
|
|
207
214
|
# @param id [String] The unique identifier of your transcript
|
208
|
-
# @param
|
209
|
-
# @param acoustic_model [String] The acoustic model that was used for the transcript
|
215
|
+
# @param audio_url [String] The URL of the media that was transcribed
|
210
216
|
# @param status [AssemblyAI::Transcripts::TranscriptStatus] The status of your transcript. Possible values are queued, processing,
|
211
217
|
# completed, or error.
|
212
218
|
# @param language_code [AssemblyAI::Transcripts::TranscriptLanguageCode] The language of your audio file.
|
213
219
|
# Possible values are found in [Supported
|
214
220
|
# Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
215
221
|
# The default value is 'en_us'.
|
216
|
-
# @param
|
222
|
+
# @param language_detection [Boolean] Whether [Automatic language
|
223
|
+
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
224
|
+
# is enabled, either true or false
|
225
|
+
# @param language_confidence_threshold [Float] The confidence threshold for the automatically detected language.
|
226
|
+
# An error will be returned if the language confidence is below this threshold.
|
227
|
+
# Defaults to 0.
|
228
|
+
# @param language_confidence [Float] The confidence score for the detected language, between 0.0 (low confidence) and
|
229
|
+
# 1.0 (high confidence)
|
230
|
+
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
|
217
231
|
# @param text [String] The textual transcript of your media file
|
218
232
|
# @param words [Array<AssemblyAI::Transcripts::TranscriptWord>] An array of temporally-sequential word objects, one for each word in the
|
219
233
|
# transcript.
|
@@ -230,10 +244,10 @@ module AssemblyAI
|
|
230
244
|
# @param audio_duration [Integer] The duration of this transcript object's media file, in seconds
|
231
245
|
# @param punctuate [Boolean] Whether Automatic Punctuation is enabled, either true or false
|
232
246
|
# @param format_text [Boolean] Whether Text Formatting is enabled, either true or false
|
247
|
+
# @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
233
248
|
# @param dual_channel [Boolean] Whether [Dual channel
|
234
249
|
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
|
235
250
|
# was enabled in the transcription request, either true or false
|
236
|
-
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
|
237
251
|
# @param webhook_url [String] The URL to which we send webhook requests.
|
238
252
|
# We sends two different types of webhook requests.
|
239
253
|
# One request when a transcript is completed or failed, and one request when the
|
@@ -284,9 +298,6 @@ module AssemblyAI
|
|
284
298
|
# Detection](https://www.assemblyai.com/docs/models/topic-detection) is enabled,
|
285
299
|
# can be true or false
|
286
300
|
# @param iab_categories_result [AssemblyAI::Transcripts::TopicDetectionModelResult]
|
287
|
-
# @param language_detection [Boolean] Whether [Automatic language
|
288
|
-
# /www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection)
|
289
|
-
# is enabled, either true or false
|
290
301
|
# @param custom_spelling [Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>] Customize how words are spelled and formatted using to and from values
|
291
302
|
# @param auto_chapters [Boolean] Whether [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters) is
|
292
303
|
# enabled, can be true or false
|
@@ -302,7 +313,6 @@ module AssemblyAI
|
|
302
313
|
# [Summarization](https://www.assemblyai.com/docs/models/summarization) is enabled
|
303
314
|
# @param custom_topics [Boolean] Whether custom topics is enabled, either true or false
|
304
315
|
# @param topics [Array<String>] The list of custom topics provided if custom topics is enabled
|
305
|
-
# @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
|
306
316
|
# @param sentiment_analysis [Boolean] Whether [Sentiment
|
307
317
|
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) is enabled,
|
308
318
|
# can be true or false
|
@@ -322,16 +332,20 @@ module AssemblyAI
|
|
322
332
|
# @param throttled [Boolean] True while a request is throttled and false when a request is no longer
|
323
333
|
# throttled
|
324
334
|
# @param error [String] Error message of why the transcript failed
|
335
|
+
# @param language_model [String] The language model that was used for the transcript
|
336
|
+
# @param acoustic_model [String] The acoustic model that was used for the transcript
|
325
337
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
326
338
|
# @return [AssemblyAI::Transcripts::Transcript]
|
327
|
-
def initialize(id:,
|
328
|
-
words: OMIT, utterances: OMIT, confidence: OMIT, audio_duration: OMIT, punctuate: OMIT, format_text: OMIT,
|
339
|
+
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)
|
329
341
|
@id = id
|
330
|
-
@
|
331
|
-
@acoustic_model = acoustic_model
|
342
|
+
@audio_url = audio_url
|
332
343
|
@status = status
|
333
344
|
@language_code = language_code if language_code != OMIT
|
334
|
-
@
|
345
|
+
@language_detection = language_detection if language_detection != OMIT
|
346
|
+
@language_confidence_threshold = language_confidence_threshold if language_confidence_threshold != OMIT
|
347
|
+
@language_confidence = language_confidence if language_confidence != OMIT
|
348
|
+
@speech_model = speech_model if speech_model != OMIT
|
335
349
|
@text = text if text != OMIT
|
336
350
|
@words = words if words != OMIT
|
337
351
|
@utterances = utterances if utterances != OMIT
|
@@ -339,8 +353,8 @@ module AssemblyAI
|
|
339
353
|
@audio_duration = audio_duration if audio_duration != OMIT
|
340
354
|
@punctuate = punctuate if punctuate != OMIT
|
341
355
|
@format_text = format_text if format_text != OMIT
|
356
|
+
@disfluencies = disfluencies if disfluencies != OMIT
|
342
357
|
@dual_channel = dual_channel if dual_channel != OMIT
|
343
|
-
@speech_model = speech_model if speech_model != OMIT
|
344
358
|
@webhook_url = webhook_url if webhook_url != OMIT
|
345
359
|
@webhook_status_code = webhook_status_code if webhook_status_code != OMIT
|
346
360
|
@webhook_auth = webhook_auth
|
@@ -364,7 +378,6 @@ module AssemblyAI
|
|
364
378
|
@content_safety_labels = content_safety_labels if content_safety_labels != OMIT
|
365
379
|
@iab_categories = iab_categories if iab_categories != OMIT
|
366
380
|
@iab_categories_result = iab_categories_result if iab_categories_result != OMIT
|
367
|
-
@language_detection = language_detection if language_detection != OMIT
|
368
381
|
@custom_spelling = custom_spelling if custom_spelling != OMIT
|
369
382
|
@auto_chapters = auto_chapters if auto_chapters != OMIT
|
370
383
|
@chapters = chapters if chapters != OMIT
|
@@ -374,7 +387,6 @@ module AssemblyAI
|
|
374
387
|
@summary = summary if summary != OMIT
|
375
388
|
@custom_topics = custom_topics if custom_topics != OMIT
|
376
389
|
@topics = topics if topics != OMIT
|
377
|
-
@disfluencies = disfluencies if disfluencies != OMIT
|
378
390
|
@sentiment_analysis = sentiment_analysis if sentiment_analysis != OMIT
|
379
391
|
@sentiment_analysis_results = sentiment_analysis_results if sentiment_analysis_results != OMIT
|
380
392
|
@entity_detection = entity_detection if entity_detection != OMIT
|
@@ -382,14 +394,18 @@ module AssemblyAI
|
|
382
394
|
@speech_threshold = speech_threshold if speech_threshold != OMIT
|
383
395
|
@throttled = throttled if throttled != OMIT
|
384
396
|
@error = error if error != OMIT
|
397
|
+
@language_model = language_model
|
398
|
+
@acoustic_model = acoustic_model
|
385
399
|
@additional_properties = additional_properties
|
386
400
|
@_field_set = {
|
387
401
|
"id": id,
|
388
|
-
"
|
389
|
-
"acoustic_model": acoustic_model,
|
402
|
+
"audio_url": audio_url,
|
390
403
|
"status": status,
|
391
404
|
"language_code": language_code,
|
392
|
-
"
|
405
|
+
"language_detection": language_detection,
|
406
|
+
"language_confidence_threshold": language_confidence_threshold,
|
407
|
+
"language_confidence": language_confidence,
|
408
|
+
"speech_model": speech_model,
|
393
409
|
"text": text,
|
394
410
|
"words": words,
|
395
411
|
"utterances": utterances,
|
@@ -397,8 +413,8 @@ module AssemblyAI
|
|
397
413
|
"audio_duration": audio_duration,
|
398
414
|
"punctuate": punctuate,
|
399
415
|
"format_text": format_text,
|
416
|
+
"disfluencies": disfluencies,
|
400
417
|
"dual_channel": dual_channel,
|
401
|
-
"speech_model": speech_model,
|
402
418
|
"webhook_url": webhook_url,
|
403
419
|
"webhook_status_code": webhook_status_code,
|
404
420
|
"webhook_auth": webhook_auth,
|
@@ -422,7 +438,6 @@ module AssemblyAI
|
|
422
438
|
"content_safety_labels": content_safety_labels,
|
423
439
|
"iab_categories": iab_categories,
|
424
440
|
"iab_categories_result": iab_categories_result,
|
425
|
-
"language_detection": language_detection,
|
426
441
|
"custom_spelling": custom_spelling,
|
427
442
|
"auto_chapters": auto_chapters,
|
428
443
|
"chapters": chapters,
|
@@ -432,14 +447,15 @@ module AssemblyAI
|
|
432
447
|
"summary": summary,
|
433
448
|
"custom_topics": custom_topics,
|
434
449
|
"topics": topics,
|
435
|
-
"disfluencies": disfluencies,
|
436
450
|
"sentiment_analysis": sentiment_analysis,
|
437
451
|
"sentiment_analysis_results": sentiment_analysis_results,
|
438
452
|
"entity_detection": entity_detection,
|
439
453
|
"entities": entities,
|
440
454
|
"speech_threshold": speech_threshold,
|
441
455
|
"throttled": throttled,
|
442
|
-
"error": error
|
456
|
+
"error": error,
|
457
|
+
"language_model": language_model,
|
458
|
+
"acoustic_model": acoustic_model
|
443
459
|
}.reject do |_k, v|
|
444
460
|
v == OMIT
|
445
461
|
end
|
@@ -453,11 +469,13 @@ module AssemblyAI
|
|
453
469
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
454
470
|
parsed_json = JSON.parse(json_object)
|
455
471
|
id = struct["id"]
|
456
|
-
|
457
|
-
acoustic_model = struct["acoustic_model"]
|
472
|
+
audio_url = struct["audio_url"]
|
458
473
|
status = struct["status"]
|
459
474
|
language_code = struct["language_code"]
|
460
|
-
|
475
|
+
language_detection = struct["language_detection"]
|
476
|
+
language_confidence_threshold = struct["language_confidence_threshold"]
|
477
|
+
language_confidence = struct["language_confidence"]
|
478
|
+
speech_model = struct["speech_model"]
|
461
479
|
text = struct["text"]
|
462
480
|
words = parsed_json["words"]&.map do |v|
|
463
481
|
v = v.to_json
|
@@ -471,8 +489,8 @@ module AssemblyAI
|
|
471
489
|
audio_duration = struct["audio_duration"]
|
472
490
|
punctuate = struct["punctuate"]
|
473
491
|
format_text = struct["format_text"]
|
492
|
+
disfluencies = struct["disfluencies"]
|
474
493
|
dual_channel = struct["dual_channel"]
|
475
|
-
speech_model = struct["speech_model"]
|
476
494
|
webhook_url = struct["webhook_url"]
|
477
495
|
webhook_status_code = struct["webhook_status_code"]
|
478
496
|
webhook_auth = struct["webhook_auth"]
|
@@ -511,7 +529,6 @@ module AssemblyAI
|
|
511
529
|
iab_categories_result = parsed_json["iab_categories_result"].to_json
|
512
530
|
iab_categories_result = AssemblyAI::Transcripts::TopicDetectionModelResult.from_json(json_object: iab_categories_result)
|
513
531
|
end
|
514
|
-
language_detection = struct["language_detection"]
|
515
532
|
custom_spelling = parsed_json["custom_spelling"]&.map do |v|
|
516
533
|
v = v.to_json
|
517
534
|
AssemblyAI::Transcripts::TranscriptCustomSpelling.from_json(json_object: v)
|
@@ -527,7 +544,6 @@ module AssemblyAI
|
|
527
544
|
summary = struct["summary"]
|
528
545
|
custom_topics = struct["custom_topics"]
|
529
546
|
topics = struct["topics"]
|
530
|
-
disfluencies = struct["disfluencies"]
|
531
547
|
sentiment_analysis = struct["sentiment_analysis"]
|
532
548
|
sentiment_analysis_results = parsed_json["sentiment_analysis_results"]&.map do |v|
|
533
549
|
v = v.to_json
|
@@ -541,13 +557,17 @@ module AssemblyAI
|
|
541
557
|
speech_threshold = struct["speech_threshold"]
|
542
558
|
throttled = struct["throttled"]
|
543
559
|
error = struct["error"]
|
560
|
+
language_model = struct["language_model"]
|
561
|
+
acoustic_model = struct["acoustic_model"]
|
544
562
|
new(
|
545
563
|
id: id,
|
546
|
-
|
547
|
-
acoustic_model: acoustic_model,
|
564
|
+
audio_url: audio_url,
|
548
565
|
status: status,
|
549
566
|
language_code: language_code,
|
550
|
-
|
567
|
+
language_detection: language_detection,
|
568
|
+
language_confidence_threshold: language_confidence_threshold,
|
569
|
+
language_confidence: language_confidence,
|
570
|
+
speech_model: speech_model,
|
551
571
|
text: text,
|
552
572
|
words: words,
|
553
573
|
utterances: utterances,
|
@@ -555,8 +575,8 @@ module AssemblyAI
|
|
555
575
|
audio_duration: audio_duration,
|
556
576
|
punctuate: punctuate,
|
557
577
|
format_text: format_text,
|
578
|
+
disfluencies: disfluencies,
|
558
579
|
dual_channel: dual_channel,
|
559
|
-
speech_model: speech_model,
|
560
580
|
webhook_url: webhook_url,
|
561
581
|
webhook_status_code: webhook_status_code,
|
562
582
|
webhook_auth: webhook_auth,
|
@@ -580,7 +600,6 @@ module AssemblyAI
|
|
580
600
|
content_safety_labels: content_safety_labels,
|
581
601
|
iab_categories: iab_categories,
|
582
602
|
iab_categories_result: iab_categories_result,
|
583
|
-
language_detection: language_detection,
|
584
603
|
custom_spelling: custom_spelling,
|
585
604
|
auto_chapters: auto_chapters,
|
586
605
|
chapters: chapters,
|
@@ -590,7 +609,6 @@ module AssemblyAI
|
|
590
609
|
summary: summary,
|
591
610
|
custom_topics: custom_topics,
|
592
611
|
topics: topics,
|
593
|
-
disfluencies: disfluencies,
|
594
612
|
sentiment_analysis: sentiment_analysis,
|
595
613
|
sentiment_analysis_results: sentiment_analysis_results,
|
596
614
|
entity_detection: entity_detection,
|
@@ -598,6 +616,8 @@ module AssemblyAI
|
|
598
616
|
speech_threshold: speech_threshold,
|
599
617
|
throttled: throttled,
|
600
618
|
error: error,
|
619
|
+
language_model: language_model,
|
620
|
+
acoustic_model: acoustic_model,
|
601
621
|
additional_properties: struct
|
602
622
|
)
|
603
623
|
end
|
@@ -617,11 +637,13 @@ module AssemblyAI
|
|
617
637
|
# @return [Void]
|
618
638
|
def self.validate_raw(obj:)
|
619
639
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
620
|
-
obj.
|
621
|
-
obj.acoustic_model.is_a?(String) != false || raise("Passed value for field obj.acoustic_model is not the expected type, validation failed.")
|
640
|
+
obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
|
622
641
|
obj.status.is_a?(AssemblyAI::Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
623
642
|
obj.language_code&.is_a?(AssemblyAI::Transcripts::TranscriptLanguageCode) != false || raise("Passed value for field obj.language_code is not the expected type, validation failed.")
|
624
|
-
obj.
|
643
|
+
obj.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
|
644
|
+
obj.language_confidence_threshold&.is_a?(Float) != false || raise("Passed value for field obj.language_confidence_threshold is not the expected type, validation failed.")
|
645
|
+
obj.language_confidence&.is_a?(Float) != false || raise("Passed value for field obj.language_confidence is not the expected type, validation failed.")
|
646
|
+
obj.speech_model&.is_a?(AssemblyAI::Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
|
625
647
|
obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
626
648
|
obj.words&.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.")
|
627
649
|
obj.utterances&.is_a?(Array) != false || raise("Passed value for field obj.utterances is not the expected type, validation failed.")
|
@@ -629,8 +651,8 @@ module AssemblyAI
|
|
629
651
|
obj.audio_duration&.is_a?(Integer) != false || raise("Passed value for field obj.audio_duration is not the expected type, validation failed.")
|
630
652
|
obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.")
|
631
653
|
obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.")
|
654
|
+
obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
|
632
655
|
obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.")
|
633
|
-
obj.speech_model&.is_a?(AssemblyAI::Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
|
634
656
|
obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.")
|
635
657
|
obj.webhook_status_code&.is_a?(Integer) != false || raise("Passed value for field obj.webhook_status_code is not the expected type, validation failed.")
|
636
658
|
obj.webhook_auth.is_a?(Boolean) != false || raise("Passed value for field obj.webhook_auth is not the expected type, validation failed.")
|
@@ -654,7 +676,6 @@ module AssemblyAI
|
|
654
676
|
obj.content_safety_labels.nil? || AssemblyAI::Transcripts::ContentSafetyLabelsResult.validate_raw(obj: obj.content_safety_labels)
|
655
677
|
obj.iab_categories&.is_a?(Boolean) != false || raise("Passed value for field obj.iab_categories is not the expected type, validation failed.")
|
656
678
|
obj.iab_categories_result.nil? || AssemblyAI::Transcripts::TopicDetectionModelResult.validate_raw(obj: obj.iab_categories_result)
|
657
|
-
obj.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
|
658
679
|
obj.custom_spelling&.is_a?(Array) != false || raise("Passed value for field obj.custom_spelling is not the expected type, validation failed.")
|
659
680
|
obj.auto_chapters&.is_a?(Boolean) != false || raise("Passed value for field obj.auto_chapters is not the expected type, validation failed.")
|
660
681
|
obj.chapters&.is_a?(Array) != false || raise("Passed value for field obj.chapters is not the expected type, validation failed.")
|
@@ -664,7 +685,6 @@ module AssemblyAI
|
|
664
685
|
obj.summary&.is_a?(String) != false || raise("Passed value for field obj.summary is not the expected type, validation failed.")
|
665
686
|
obj.custom_topics&.is_a?(Boolean) != false || raise("Passed value for field obj.custom_topics is not the expected type, validation failed.")
|
666
687
|
obj.topics&.is_a?(Array) != false || raise("Passed value for field obj.topics is not the expected type, validation failed.")
|
667
|
-
obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
|
668
688
|
obj.sentiment_analysis&.is_a?(Boolean) != false || raise("Passed value for field obj.sentiment_analysis is not the expected type, validation failed.")
|
669
689
|
obj.sentiment_analysis_results&.is_a?(Array) != false || raise("Passed value for field obj.sentiment_analysis_results is not the expected type, validation failed.")
|
670
690
|
obj.entity_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.entity_detection is not the expected type, validation failed.")
|
@@ -672,6 +692,8 @@ module AssemblyAI
|
|
672
692
|
obj.speech_threshold&.is_a?(Float) != false || raise("Passed value for field obj.speech_threshold is not the expected type, validation failed.")
|
673
693
|
obj.throttled&.is_a?(Boolean) != false || raise("Passed value for field obj.throttled is not the expected type, validation failed.")
|
674
694
|
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
|
695
|
+
obj.language_model.is_a?(String) != false || raise("Passed value for field obj.language_model is not the expected type, validation failed.")
|
696
|
+
obj.acoustic_model.is_a?(String) != false || raise("Passed value for field obj.acoustic_model is not the expected type, validation failed.")
|
675
697
|
end
|
676
698
|
end
|
677
699
|
end
|
@@ -39,13 +39,13 @@ module AssemblyAI
|
|
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]
|
42
|
-
def initialize(id:, resource_url:, status:, created:,
|
42
|
+
def initialize(id:, resource_url:, status:, created:, audio_url:, completed: OMIT, error: OMIT,
|
43
43
|
additional_properties: nil)
|
44
44
|
@id = id
|
45
45
|
@resource_url = resource_url
|
46
46
|
@status = status
|
47
47
|
@created = created
|
48
|
-
@completed = completed
|
48
|
+
@completed = completed if completed != OMIT
|
49
49
|
@audio_url = audio_url
|
50
50
|
@error = error if error != OMIT
|
51
51
|
@additional_properties = additional_properties
|
@@ -106,7 +106,7 @@ module AssemblyAI
|
|
106
106
|
obj.resource_url.is_a?(String) != false || raise("Passed value for field obj.resource_url is not the expected type, validation failed.")
|
107
107
|
obj.status.is_a?(AssemblyAI::Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
108
108
|
obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
|
109
|
-
obj.completed
|
109
|
+
obj.completed&.is_a?(DateTime) != false || raise("Passed value for field obj.completed is not the expected type, validation failed.")
|
110
110
|
obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
|
111
111
|
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
|
112
112
|
end
|