Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 523bd00

Browse files
committed
SDK regeneration
1 parent 526733c commit 523bd00

File tree

6 files changed

+467
-248
lines changed

6 files changed

+467
-248
lines changed

lib/assemblyai/transcripts/client.rb

Lines changed: 341 additions & 155 deletions
Large diffs are not rendered by default.

lib/assemblyai/transcripts/types/transcript.rb

Lines changed: 78 additions & 56 deletions
Large diffs are not rendered by default.

lib/assemblyai/transcripts/types/transcript_boost_param.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module AssemblyAI
44
class Transcripts
5-
# The word boost parameter value
5+
# How much to boost specified words
66
class TranscriptBoostParam
77
LOW = "low"
88
DEFAULT = "default"

lib/assemblyai/transcripts/types/transcript_list_item.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class TranscriptListItem
3939
# @param error [String] Error message of why the transcript failed
4040
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
4141
# @return [AssemblyAI::Transcripts::TranscriptListItem]
42-
def initialize(id:, resource_url:, status:, created:, completed:, audio_url:, error: OMIT,
42+
def initialize(id:, resource_url:, status:, created:, audio_url:, completed: OMIT, error: OMIT,
4343
additional_properties: nil)
4444
@id = id
4545
@resource_url = resource_url
4646
@status = status
4747
@created = created
48-
@completed = completed
48+
@completed = completed if completed != OMIT
4949
@audio_url = audio_url
5050
@error = error if error != OMIT
5151
@additional_properties = additional_properties
@@ -106,7 +106,7 @@ def self.validate_raw(obj:)
106106
obj.resource_url.is_a?(String) != false || raise("Passed value for field obj.resource_url is not the expected type, validation failed.")
107107
obj.status.is_a?(AssemblyAI::Transcripts::TranscriptStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
108108
obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
109-
obj.completed.is_a?(DateTime) != false || raise("Passed value for field obj.completed is not the expected type, validation failed.")
109+
obj.completed&.is_a?(DateTime) != false || raise("Passed value for field obj.completed is not the expected type, validation failed.")
110110
obj.audio_url.is_a?(String) != false || raise("Passed value for field obj.audio_url is not the expected type, validation failed.")
111111
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
112112
end

lib/assemblyai/transcripts/types/transcript_optional_params.rb

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,26 @@ class Transcripts
1818
class TranscriptOptionalParams
1919
# @return [AssemblyAI::Transcripts::TranscriptLanguageCode]
2020
attr_reader :language_code
21+
# @return [Boolean] Enable [Automatic language
22+
# www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection),
23+
# either true or false.
24+
attr_reader :language_detection
25+
# @return [Float] The confidence threshold for the automatically detected language.
26+
# An error will be returned if the language confidence is below this threshold.
27+
# Defaults to 0.
28+
attr_reader :language_confidence_threshold
29+
# @return [AssemblyAI::Transcripts::SpeechModel]
30+
attr_reader :speech_model
2131
# @return [Boolean] Enable Automatic Punctuation, can be true or false
2232
attr_reader :punctuate
2333
# @return [Boolean] Enable Text Formatting, can be true or false
2434
attr_reader :format_text
35+
# @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
36+
attr_reader :disfluencies
2537
# @return [Boolean] Enable [Dual
2638
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
2739
# transcription, can be true or false.
2840
attr_reader :dual_channel
29-
# @return [AssemblyAI::Transcripts::SpeechModel]
30-
attr_reader :speech_model
3141
# @return [String] The URL to which we send webhook requests. We sends two different types of
3242
# webhook requests. One request when a transcript is completed or failed, and one
3343
# request when the redacted audio is ready if redact_pii_audio is enabled.
@@ -46,7 +56,7 @@ class TranscriptOptionalParams
4656
attr_reader :audio_end_at
4757
# @return [Array<String>] The list of custom vocabulary to boost transcription probability for
4858
attr_reader :word_boost
49-
# @return [AssemblyAI::Transcripts::TranscriptBoostParam] The word boost parameter value
59+
# @return [AssemblyAI::Transcripts::TranscriptBoostParam] How much to boost specified words
5060
attr_reader :boost_param
5161
# @return [Boolean] Filter profanity from the transcribed text, can be true or false
5262
attr_reader :filter_profanity
@@ -89,14 +99,8 @@ class TranscriptOptionalParams
8999
# Detection](https://www.assemblyai.com/docs/models/topic-detection), can be true
90100
# or false
91101
attr_reader :iab_categories
92-
# @return [Boolean] Enable [Automatic language
93-
# www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection),
94-
# either true or false.
95-
attr_reader :language_detection
96102
# @return [Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>] Customize how words are spelled and formatted using to and from values
97103
attr_reader :custom_spelling
98-
# @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
99-
attr_reader :disfluencies
100104
# @return [Boolean] Enable [Sentiment
101105
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be
102106
# true or false
@@ -131,12 +135,19 @@ class TranscriptOptionalParams
131135
OMIT = Object.new
132136

133137
# @param language_code [AssemblyAI::Transcripts::TranscriptLanguageCode]
138+
# @param language_detection [Boolean] Enable [Automatic language
139+
# www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection),
140+
# either true or false.
141+
# @param language_confidence_threshold [Float] The confidence threshold for the automatically detected language.
142+
# An error will be returned if the language confidence is below this threshold.
143+
# Defaults to 0.
144+
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
134145
# @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
135146
# @param format_text [Boolean] Enable Text Formatting, can be true or false
147+
# @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
136148
# @param dual_channel [Boolean] Enable [Dual
137149
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
138150
# transcription, can be true or false.
139-
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
140151
# @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of
141152
# webhook requests. One request when a transcript is completed or failed, and one
142153
# request when the redacted audio is ready if redact_pii_audio is enabled.
@@ -148,7 +159,7 @@ class TranscriptOptionalParams
148159
# @param audio_start_from [Integer] The point in time, in milliseconds, to begin transcribing in your media file
149160
# @param audio_end_at [Integer] The point in time, in milliseconds, to stop transcribing in your media file
150161
# @param word_boost [Array<String>] The list of custom vocabulary to boost transcription probability for
151-
# @param boost_param [AssemblyAI::Transcripts::TranscriptBoostParam] The word boost parameter value
162+
# @param boost_param [AssemblyAI::Transcripts::TranscriptBoostParam] How much to boost specified words
152163
# @param filter_profanity [Boolean] Filter profanity from the transcribed text, can be true or false
153164
# @param redact_pii [Boolean] Redact PII from the transcribed text using the Redact PII model, can be true or
154165
# false
@@ -179,11 +190,7 @@ class TranscriptOptionalParams
179190
# @param iab_categories [Boolean] Enable [Topic
180191
# Detection](https://www.assemblyai.com/docs/models/topic-detection), can be true
181192
# or false
182-
# @param language_detection [Boolean] Enable [Automatic language
183-
# www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection),
184-
# either true or false.
185193
# @param custom_spelling [Array<AssemblyAI::Transcripts::TranscriptCustomSpelling>] Customize how words are spelled and formatted using to and from values
186-
# @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false
187194
# @param sentiment_analysis [Boolean] Enable [Sentiment
188195
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be
189196
# true or false
@@ -202,13 +209,16 @@ class TranscriptOptionalParams
202209
# @param topics [Array<String>] The list of custom topics
203210
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
204211
# @return [AssemblyAI::Transcripts::TranscriptOptionalParams]
205-
def initialize(language_code: OMIT, punctuate: OMIT, format_text: OMIT, dual_channel: OMIT, speech_model: OMIT,
206-
webhook_url: OMIT, webhook_auth_header_name: OMIT, webhook_auth_header_value: OMIT, auto_highlights: OMIT, audio_start_from: OMIT, audio_end_at: OMIT, word_boost: OMIT, boost_param: OMIT, filter_profanity: OMIT, redact_pii: OMIT, redact_pii_audio: OMIT, redact_pii_audio_quality: OMIT, redact_pii_policies: OMIT, redact_pii_sub: OMIT, speaker_labels: OMIT, speakers_expected: OMIT, content_safety: OMIT, content_safety_confidence: OMIT, iab_categories: OMIT, language_detection: OMIT, custom_spelling: OMIT, disfluencies: OMIT, sentiment_analysis: OMIT, auto_chapters: OMIT, entity_detection: OMIT, speech_threshold: OMIT, summarization: OMIT, summary_model: OMIT, summary_type: OMIT, custom_topics: OMIT, topics: OMIT, additional_properties: nil)
212+
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)
207214
@language_code = language_code if language_code != OMIT
215+
@language_detection = language_detection if language_detection != OMIT
216+
@language_confidence_threshold = language_confidence_threshold if language_confidence_threshold != OMIT
217+
@speech_model = speech_model if speech_model != OMIT
208218
@punctuate = punctuate if punctuate != OMIT
209219
@format_text = format_text if format_text != OMIT
220+
@disfluencies = disfluencies if disfluencies != OMIT
210221
@dual_channel = dual_channel if dual_channel != OMIT
211-
@speech_model = speech_model if speech_model != OMIT
212222
@webhook_url = webhook_url if webhook_url != OMIT
213223
@webhook_auth_header_name = webhook_auth_header_name if webhook_auth_header_name != OMIT
214224
@webhook_auth_header_value = webhook_auth_header_value if webhook_auth_header_value != OMIT
@@ -228,9 +238,7 @@ def initialize(language_code: OMIT, punctuate: OMIT, format_text: OMIT, dual_cha
228238
@content_safety = content_safety if content_safety != OMIT
229239
@content_safety_confidence = content_safety_confidence if content_safety_confidence != OMIT
230240
@iab_categories = iab_categories if iab_categories != OMIT
231-
@language_detection = language_detection if language_detection != OMIT
232241
@custom_spelling = custom_spelling if custom_spelling != OMIT
233-
@disfluencies = disfluencies if disfluencies != OMIT
234242
@sentiment_analysis = sentiment_analysis if sentiment_analysis != OMIT
235243
@auto_chapters = auto_chapters if auto_chapters != OMIT
236244
@entity_detection = entity_detection if entity_detection != OMIT
@@ -243,10 +251,13 @@ def initialize(language_code: OMIT, punctuate: OMIT, format_text: OMIT, dual_cha
243251
@additional_properties = additional_properties
244252
@_field_set = {
245253
"language_code": language_code,
254+
"language_detection": language_detection,
255+
"language_confidence_threshold": language_confidence_threshold,
256+
"speech_model": speech_model,
246257
"punctuate": punctuate,
247258
"format_text": format_text,
259+
"disfluencies": disfluencies,
248260
"dual_channel": dual_channel,
249-
"speech_model": speech_model,
250261
"webhook_url": webhook_url,
251262
"webhook_auth_header_name": webhook_auth_header_name,
252263
"webhook_auth_header_value": webhook_auth_header_value,
@@ -266,9 +277,7 @@ def initialize(language_code: OMIT, punctuate: OMIT, format_text: OMIT, dual_cha
266277
"content_safety": content_safety,
267278
"content_safety_confidence": content_safety_confidence,
268279
"iab_categories": iab_categories,
269-
"language_detection": language_detection,
270280
"custom_spelling": custom_spelling,
271-
"disfluencies": disfluencies,
272281
"sentiment_analysis": sentiment_analysis,
273282
"auto_chapters": auto_chapters,
274283
"entity_detection": entity_detection,
@@ -291,10 +300,13 @@ def self.from_json(json_object:)
291300
struct = JSON.parse(json_object, object_class: OpenStruct)
292301
parsed_json = JSON.parse(json_object)
293302
language_code = struct["language_code"]
303+
language_detection = struct["language_detection"]
304+
language_confidence_threshold = struct["language_confidence_threshold"]
305+
speech_model = struct["speech_model"]
294306
punctuate = struct["punctuate"]
295307
format_text = struct["format_text"]
308+
disfluencies = struct["disfluencies"]
296309
dual_channel = struct["dual_channel"]
297-
speech_model = struct["speech_model"]
298310
webhook_url = struct["webhook_url"]
299311
webhook_auth_header_name = struct["webhook_auth_header_name"]
300312
webhook_auth_header_value = struct["webhook_auth_header_value"]
@@ -314,12 +326,10 @@ def self.from_json(json_object:)
314326
content_safety = struct["content_safety"]
315327
content_safety_confidence = struct["content_safety_confidence"]
316328
iab_categories = struct["iab_categories"]
317-
language_detection = struct["language_detection"]
318329
custom_spelling = parsed_json["custom_spelling"]&.map do |v|
319330
v = v.to_json
320331
AssemblyAI::Transcripts::TranscriptCustomSpelling.from_json(json_object: v)
321332
end
322-
disfluencies = struct["disfluencies"]
323333
sentiment_analysis = struct["sentiment_analysis"]
324334
auto_chapters = struct["auto_chapters"]
325335
entity_detection = struct["entity_detection"]
@@ -331,10 +341,13 @@ def self.from_json(json_object:)
331341
topics = struct["topics"]
332342
new(
333343
language_code: language_code,
344+
language_detection: language_detection,
345+
language_confidence_threshold: language_confidence_threshold,
346+
speech_model: speech_model,
334347
punctuate: punctuate,
335348
format_text: format_text,
349+
disfluencies: disfluencies,
336350
dual_channel: dual_channel,
337-
speech_model: speech_model,
338351
webhook_url: webhook_url,
339352
webhook_auth_header_name: webhook_auth_header_name,
340353
webhook_auth_header_value: webhook_auth_header_value,
@@ -354,9 +367,7 @@ def self.from_json(json_object:)
354367
content_safety: content_safety,
355368
content_safety_confidence: content_safety_confidence,
356369
iab_categories: iab_categories,
357-
language_detection: language_detection,
358370
custom_spelling: custom_spelling,
359-
disfluencies: disfluencies,
360371
sentiment_analysis: sentiment_analysis,
361372
auto_chapters: auto_chapters,
362373
entity_detection: entity_detection,
@@ -385,10 +396,13 @@ def to_json(*_args)
385396
# @return [Void]
386397
def self.validate_raw(obj:)
387398
obj.language_code&.is_a?(AssemblyAI::Transcripts::TranscriptLanguageCode) != false || raise("Passed value for field obj.language_code is not the expected type, validation failed.")
399+
obj.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
400+
obj.language_confidence_threshold&.is_a?(Float) != false || raise("Passed value for field obj.language_confidence_threshold is not the expected type, validation failed.")
401+
obj.speech_model&.is_a?(AssemblyAI::Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
388402
obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.")
389403
obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.")
404+
obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
390405
obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.")
391-
obj.speech_model&.is_a?(AssemblyAI::Transcripts::SpeechModel) != false || raise("Passed value for field obj.speech_model is not the expected type, validation failed.")
392406
obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.")
393407
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.")
394408
obj.webhook_auth_header_value&.is_a?(String) != false || raise("Passed value for field obj.webhook_auth_header_value is not the expected type, validation failed.")
@@ -408,9 +422,7 @@ def self.validate_raw(obj:)
408422
obj.content_safety&.is_a?(Boolean) != false || raise("Passed value for field obj.content_safety is not the expected type, validation failed.")
409423
obj.content_safety_confidence&.is_a?(Integer) != false || raise("Passed value for field obj.content_safety_confidence is not the expected type, validation failed.")
410424
obj.iab_categories&.is_a?(Boolean) != false || raise("Passed value for field obj.iab_categories is not the expected type, validation failed.")
411-
obj.language_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.language_detection is not the expected type, validation failed.")
412425
obj.custom_spelling&.is_a?(Array) != false || raise("Passed value for field obj.custom_spelling is not the expected type, validation failed.")
413-
obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.")
414426
obj.sentiment_analysis&.is_a?(Boolean) != false || raise("Passed value for field obj.sentiment_analysis is not the expected type, validation failed.")
415427
obj.auto_chapters&.is_a?(Boolean) != false || raise("Passed value for field obj.auto_chapters is not the expected type, validation failed.")
416428
obj.entity_detection&.is_a?(Boolean) != false || raise("Passed value for field obj.entity_detection is not the expected type, validation failed.")

lib/types_export.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,3 @@
8585
require_relative "assemblyai/lemur/types/lemur_model"
8686
require_relative "assemblyai/lemur/types/lemur_usage"
8787
require_relative "assemblyai/types/error"
88-
require_relative "assemblyai/types/user_agent"

0 commit comments

Comments
 (0)