diff --git a/lib/assemblyai/lemur/types/lemur_model.rb b/lib/assemblyai/lemur/types/lemur_model.rb index ebb4a4c..b512981 100644 --- a/lib/assemblyai/lemur/types/lemur_model.rb +++ b/lib/assemblyai/lemur/types/lemur_model.rb @@ -9,7 +9,7 @@ class LemurModel ANTHROPIC_CLAUDE3_HAIKU = "anthropic/claude-3-haiku" ANTHROPIC_CLAUDE3_SONNET = "anthropic/claude-3-sonnet" ANTHROPIC_CLAUDE2_1 = "anthropic/claude-2-1" - ANTHROPIC_CLAUDE2 = "anthropic/claude-2" + ANTHROPIC_CLAUDE2_0 = "anthropic/claude-2" DEFAULT = "default" ANTHROPIC_CLAUDE_INSTANT1_2 = "anthropic/claude-instant-1-2" BASIC = "basic" diff --git a/lib/assemblyai/transcripts/client.rb b/lib/assemblyai/transcripts/client.rb index 472c6d3..0bbab9c 100644 --- a/lib/assemblyai/transcripts/client.rb +++ b/lib/assemblyai/transcripts/client.rb @@ -35,7 +35,7 @@ def initialize(request_client:) # Transcripts are sorted from newest to oldest. The previous URL always points to # a page with older transcripts. # - # @param limit [Long] Maximum amount of transcripts to retrieve + # @param limit [Integer] Maximum amount of transcripts to retrieve # @param status [AssemblyAI::Transcripts::TranscriptStatus] Filter by transcript status # @param created_on [String] Only get transcripts created on this date # @param before_id [String] Get transcripts that were created before this transcript ID @@ -83,12 +83,16 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false # @param format_text [Boolean] Enable Text Formatting, can be true or false # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false + # @param multichannel [Boolean] Enable + # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) + # transcription, can be true or false. # @param dual_channel [Boolean] Enable [Dual # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) # transcription, can be true or false. - # @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of - # webhook requests. One request when a transcript is completed or failed, and one - # request when the redacted audio is ready if redact_pii_audio is enabled. + # @param webhook_url [String] The URL to which we send webhook requests. + # We sends two different types of webhook requests. + # One request when a transcript is completed or failed, and one request when the + # redacted audio is ready if redact_pii_audio is enabled. # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook # requests # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook @@ -158,7 +162,7 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil # ) # api.transcripts.submit(audio_url: "https://assembly.ai/wildfires.mp3") def submit(audio_url:, language_code: nil, language_detection: nil, language_confidence_threshold: nil, speech_model: nil, - 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) + 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) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? @@ -172,6 +176,7 @@ def submit(audio_url:, language_code: nil, language_detection: nil, language_con punctuate: punctuate, format_text: format_text, disfluencies: disfluencies, + multichannel: multichannel, dual_channel: dual_channel, webhook_url: webhook_url, webhook_auth_header_name: webhook_auth_header_name, @@ -380,7 +385,7 @@ def initialize(request_client:) # Transcripts are sorted from newest to oldest. The previous URL always points to # a page with older transcripts. # - # @param limit [Long] Maximum amount of transcripts to retrieve + # @param limit [Integer] Maximum amount of transcripts to retrieve # @param status [AssemblyAI::Transcripts::TranscriptStatus] Filter by transcript status # @param created_on [String] Only get transcripts created on this date # @param before_id [String] Get transcripts that were created before this transcript ID @@ -430,12 +435,16 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false # @param format_text [Boolean] Enable Text Formatting, can be true or false # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false + # @param multichannel [Boolean] Enable + # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) + # transcription, can be true or false. # @param dual_channel [Boolean] Enable [Dual # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) # transcription, can be true or false. - # @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of - # webhook requests. One request when a transcript is completed or failed, and one - # request when the redacted audio is ready if redact_pii_audio is enabled. + # @param webhook_url [String] The URL to which we send webhook requests. + # We sends two different types of webhook requests. + # One request when a transcript is completed or failed, and one request when the + # redacted audio is ready if redact_pii_audio is enabled. # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook # requests # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook @@ -505,7 +514,7 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil # ) # api.transcripts.submit(audio_url: "https://assembly.ai/wildfires.mp3") def submit(audio_url:, language_code: nil, language_detection: nil, language_confidence_threshold: nil, speech_model: nil, - 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) + 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) Async do response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? @@ -520,6 +529,7 @@ def submit(audio_url:, language_code: nil, language_detection: nil, language_con punctuate: punctuate, format_text: format_text, disfluencies: disfluencies, + multichannel: multichannel, dual_channel: dual_channel, webhook_url: webhook_url, webhook_auth_header_name: webhook_auth_header_name, diff --git a/lib/assemblyai/transcripts/types/content_safety_labels_result.rb b/lib/assemblyai/transcripts/types/content_safety_labels_result.rb index 0b7770b..2cd2915 100644 --- a/lib/assemblyai/transcripts/types/content_safety_labels_result.rb +++ b/lib/assemblyai/transcripts/types/content_safety_labels_result.rb @@ -15,7 +15,7 @@ class ContentSafetyLabelsResult # @return [AssemblyAI::Transcripts::AudioIntelligenceModelStatus] The status of the Content Moderation model. Either success, or unavailable in # the rare case that the model failed. attr_reader :status - # @return [Array] + # @return [Array] An array of results for the Content Moderation model attr_reader :results # @return [Hash{String => Float}] A summary of the Content Moderation confidence results for the entire audio file attr_reader :summary @@ -31,7 +31,7 @@ class ContentSafetyLabelsResult # @param status [AssemblyAI::Transcripts::AudioIntelligenceModelStatus] The status of the Content Moderation model. Either success, or unavailable in # the rare case that the model failed. - # @param results [Array] + # @param results [Array] An array of results for the Content Moderation model # @param summary [Hash{String => Float}] A summary of the Content Moderation confidence results for the entire audio file # @param severity_score_summary [Hash{String => AssemblyAI::Transcripts::SeverityScoreSummary}] A summary of the Content Moderation severity results for the entire audio file # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition diff --git a/lib/assemblyai/transcripts/types/paragraphs_response.rb b/lib/assemblyai/transcripts/types/paragraphs_response.rb index 3566571..283e5d1 100644 --- a/lib/assemblyai/transcripts/types/paragraphs_response.rb +++ b/lib/assemblyai/transcripts/types/paragraphs_response.rb @@ -7,13 +7,13 @@ module AssemblyAI class Transcripts class ParagraphsResponse - # @return [String] + # @return [String] The unique identifier of your transcript attr_reader :id - # @return [Float] + # @return [Float] The confidence score for the transcript attr_reader :confidence - # @return [Float] + # @return [Float] The duration of the audio file in seconds attr_reader :audio_duration - # @return [Array] + # @return [Array] An array of paragraphs in the transcript attr_reader :paragraphs # @return [OpenStruct] Additional properties unmapped to the current class definition attr_reader :additional_properties @@ -23,10 +23,10 @@ class ParagraphsResponse OMIT = Object.new - # @param id [String] - # @param confidence [Float] - # @param audio_duration [Float] - # @param paragraphs [Array] + # @param id [String] The unique identifier of your transcript + # @param confidence [Float] The confidence score for the transcript + # @param audio_duration [Float] The duration of the audio file in seconds + # @param paragraphs [Array] An array of paragraphs in the transcript # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::ParagraphsResponse] def initialize(id:, confidence:, audio_duration:, paragraphs:, additional_properties: nil) diff --git a/lib/assemblyai/transcripts/types/sentences_response.rb b/lib/assemblyai/transcripts/types/sentences_response.rb index 1c8ec7d..93fab41 100644 --- a/lib/assemblyai/transcripts/types/sentences_response.rb +++ b/lib/assemblyai/transcripts/types/sentences_response.rb @@ -7,13 +7,13 @@ module AssemblyAI class Transcripts class SentencesResponse - # @return [String] + # @return [String] The unique identifier for the transcript attr_reader :id - # @return [Float] + # @return [Float] The confidence score for the transcript attr_reader :confidence - # @return [Float] + # @return [Float] The duration of the audio file in seconds attr_reader :audio_duration - # @return [Array] + # @return [Array] An array of sentences in the transcript attr_reader :sentences # @return [OpenStruct] Additional properties unmapped to the current class definition attr_reader :additional_properties @@ -23,10 +23,10 @@ class SentencesResponse OMIT = Object.new - # @param id [String] - # @param confidence [Float] - # @param audio_duration [Float] - # @param sentences [Array] + # @param id [String] The unique identifier for the transcript + # @param confidence [Float] The confidence score for the transcript + # @param audio_duration [Float] The duration of the audio file in seconds + # @param sentences [Array] An array of sentences in the transcript # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::SentencesResponse] def initialize(id:, confidence:, audio_duration:, sentences:, additional_properties: nil) diff --git a/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb b/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb index 5541137..c6e7d7c 100644 --- a/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb +++ b/lib/assemblyai/transcripts/types/sentiment_analysis_result.rb @@ -18,6 +18,9 @@ class SentimentAnalysisResult attr_reader :sentiment # @return [Float] The confidence score for the detected sentiment of the sentence, from 0 to 1 attr_reader :confidence + # @return [String] The channel of this utterance. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. + attr_reader :channel # @return [String] The speaker of the sentence if [Speaker # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is # enabled, else null @@ -35,17 +38,21 @@ class SentimentAnalysisResult # @param end_ [Integer] The ending time, in milliseconds, of the sentence # @param sentiment [AssemblyAI::Transcripts::Sentiment] The detected sentiment for the sentence, one of POSITIVE, NEUTRAL, NEGATIVE # @param confidence [Float] The confidence score for the detected sentiment of the sentence, from 0 to 1 + # @param channel [String] The channel of this utterance. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. # @param speaker [String] The speaker of the sentence if [Speaker # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is # enabled, else null # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::SentimentAnalysisResult] - def initialize(text:, start:, end_:, sentiment:, confidence:, speaker: OMIT, additional_properties: nil) + def initialize(text:, start:, end_:, sentiment:, confidence:, channel: OMIT, speaker: OMIT, + additional_properties: nil) @text = text @start = start @end_ = end_ @sentiment = sentiment @confidence = confidence + @channel = channel if channel != OMIT @speaker = speaker if speaker != OMIT @additional_properties = additional_properties @_field_set = { @@ -54,6 +61,7 @@ def initialize(text:, start:, end_:, sentiment:, confidence:, speaker: OMIT, add "end": end_, "sentiment": sentiment, "confidence": confidence, + "channel": channel, "speaker": speaker }.reject do |_k, v| v == OMIT @@ -71,6 +79,7 @@ def self.from_json(json_object:) end_ = struct["end"] sentiment = struct["sentiment"] confidence = struct["confidence"] + channel = struct["channel"] speaker = struct["speaker"] new( text: text, @@ -78,6 +87,7 @@ def self.from_json(json_object:) end_: end_, sentiment: sentiment, confidence: confidence, + channel: channel, speaker: speaker, additional_properties: struct ) @@ -102,6 +112,7 @@ def self.validate_raw(obj:) obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.") obj.sentiment.is_a?(AssemblyAI::Transcripts::Sentiment) != false || raise("Passed value for field obj.sentiment is not the expected type, validation failed.") obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.") + obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.") obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.") end end diff --git a/lib/assemblyai/transcripts/types/topic_detection_result.rb b/lib/assemblyai/transcripts/types/topic_detection_result.rb index 2a83d8d..0ff11c8 100644 --- a/lib/assemblyai/transcripts/types/topic_detection_result.rb +++ b/lib/assemblyai/transcripts/types/topic_detection_result.rb @@ -11,7 +11,7 @@ class Transcripts class TopicDetectionResult # @return [String] The text in the transcript in which a detected topic occurs attr_reader :text - # @return [Array] + # @return [Array] An array of detected topics in the text attr_reader :labels # @return [AssemblyAI::Transcripts::Timestamp] attr_reader :timestamp @@ -24,7 +24,7 @@ class TopicDetectionResult OMIT = Object.new # @param text [String] The text in the transcript in which a detected topic occurs - # @param labels [Array] + # @param labels [Array] An array of detected topics in the text # @param timestamp [AssemblyAI::Transcripts::Timestamp] # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TopicDetectionResult] diff --git a/lib/assemblyai/transcripts/types/transcript.rb b/lib/assemblyai/transcripts/types/transcript.rb index 83375f5..832d6ba 100644 --- a/lib/assemblyai/transcripts/types/transcript.rb +++ b/lib/assemblyai/transcripts/types/transcript.rb @@ -40,7 +40,6 @@ class Transcript attr_reader :language_detection # @return [Float] The confidence threshold for the automatically detected language. # An error will be returned if the language confidence is below this threshold. - # Defaults to 0. attr_reader :language_confidence_threshold # @return [Float] The confidence score for the detected language, between 0.0 (low confidence) and # 1.0 (high confidence) @@ -72,6 +71,13 @@ class Transcript attr_reader :format_text # @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false attr_reader :disfluencies + # @return [Boolean] Whether [Multichannel + # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) + # was enabled in the transcription request, either true or false + attr_reader :multichannel + # @return [Integer] The number of audio channels in the audio file. This is only present when + # multichannel is enabled. + attr_reader :audio_channels # @return [Boolean] Whether [Dual channel # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) # was enabled in the transcription request, either true or false @@ -224,7 +230,6 @@ class Transcript # is enabled, either true or false # @param language_confidence_threshold [Float] The confidence threshold for the automatically detected language. # An error will be returned if the language confidence is below this threshold. - # Defaults to 0. # @param language_confidence [Float] The confidence score for the detected language, between 0.0 (low confidence) and # 1.0 (high confidence) # @param speech_model [AssemblyAI::Transcripts::SpeechModel] @@ -245,6 +250,11 @@ class Transcript # @param punctuate [Boolean] Whether Automatic Punctuation is enabled, either true or false # @param format_text [Boolean] Whether Text Formatting is enabled, either true or false # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false + # @param multichannel [Boolean] Whether [Multichannel + # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) + # was enabled in the transcription request, either true or false + # @param audio_channels [Integer] The number of audio channels in the audio file. This is only present when + # multichannel is enabled. # @param dual_channel [Boolean] Whether [Dual channel # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) # was enabled in the transcription request, either true or false @@ -337,7 +347,7 @@ class Transcript # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::Transcript] def initialize(id:, audio_url:, status:, webhook_auth:, auto_highlights:, redact_pii:, summarization:, language_model:, acoustic_model:, language_code: OMIT, language_detection: OMIT, - 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) + 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) @id = id @audio_url = audio_url @status = status @@ -354,6 +364,8 @@ def initialize(id:, audio_url:, status:, webhook_auth:, auto_highlights:, redact @punctuate = punctuate if punctuate != OMIT @format_text = format_text if format_text != OMIT @disfluencies = disfluencies if disfluencies != OMIT + @multichannel = multichannel if multichannel != OMIT + @audio_channels = audio_channels if audio_channels != OMIT @dual_channel = dual_channel if dual_channel != OMIT @webhook_url = webhook_url if webhook_url != OMIT @webhook_status_code = webhook_status_code if webhook_status_code != OMIT @@ -414,6 +426,8 @@ def initialize(id:, audio_url:, status:, webhook_auth:, auto_highlights:, redact "punctuate": punctuate, "format_text": format_text, "disfluencies": disfluencies, + "multichannel": multichannel, + "audio_channels": audio_channels, "dual_channel": dual_channel, "webhook_url": webhook_url, "webhook_status_code": webhook_status_code, @@ -490,6 +504,8 @@ def self.from_json(json_object:) punctuate = struct["punctuate"] format_text = struct["format_text"] disfluencies = struct["disfluencies"] + multichannel = struct["multichannel"] + audio_channels = struct["audio_channels"] dual_channel = struct["dual_channel"] webhook_url = struct["webhook_url"] webhook_status_code = struct["webhook_status_code"] @@ -576,6 +592,8 @@ def self.from_json(json_object:) punctuate: punctuate, format_text: format_text, disfluencies: disfluencies, + multichannel: multichannel, + audio_channels: audio_channels, dual_channel: dual_channel, webhook_url: webhook_url, webhook_status_code: webhook_status_code, @@ -652,6 +670,8 @@ def self.validate_raw(obj:) obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.") obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.") obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.") + obj.multichannel&.is_a?(Boolean) != false || raise("Passed value for field obj.multichannel is not the expected type, validation failed.") + obj.audio_channels&.is_a?(Integer) != false || raise("Passed value for field obj.audio_channels is not the expected type, validation failed.") obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.") obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.") obj.webhook_status_code&.is_a?(Integer) != false || raise("Passed value for field obj.webhook_status_code is not the expected type, validation failed.") diff --git a/lib/assemblyai/transcripts/types/transcript_list.rb b/lib/assemblyai/transcripts/types/transcript_list.rb index 0d11965..e627102 100644 --- a/lib/assemblyai/transcripts/types/transcript_list.rb +++ b/lib/assemblyai/transcripts/types/transcript_list.rb @@ -10,9 +10,9 @@ class Transcripts # A list of transcripts. Transcripts are sorted from newest to oldest. The # previous URL always points to a page with older transcripts. class TranscriptList - # @return [AssemblyAI::Transcripts::PageDetails] + # @return [AssemblyAI::Transcripts::PageDetails] Details of the transcript page attr_reader :page_details - # @return [Array] + # @return [Array] An array of transcripts attr_reader :transcripts # @return [OpenStruct] Additional properties unmapped to the current class definition attr_reader :additional_properties @@ -22,8 +22,8 @@ class TranscriptList OMIT = Object.new - # @param page_details [AssemblyAI::Transcripts::PageDetails] - # @param transcripts [Array] + # @param page_details [AssemblyAI::Transcripts::PageDetails] Details of the transcript page + # @param transcripts [Array] An array of transcripts # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TranscriptList] def initialize(page_details:, transcripts:, additional_properties: nil) diff --git a/lib/assemblyai/transcripts/types/transcript_list_item.rb b/lib/assemblyai/transcripts/types/transcript_list_item.rb index f6d1f90..b4d94e1 100644 --- a/lib/assemblyai/transcripts/types/transcript_list_item.rb +++ b/lib/assemblyai/transcripts/types/transcript_list_item.rb @@ -8,17 +8,17 @@ module AssemblyAI class Transcripts class TranscriptListItem - # @return [String] + # @return [String] The unique identifier for the transcript attr_reader :id - # @return [String] + # @return [String] The URL to retrieve the transcript attr_reader :resource_url - # @return [AssemblyAI::Transcripts::TranscriptStatus] + # @return [AssemblyAI::Transcripts::TranscriptStatus] The status of the transcript attr_reader :status - # @return [DateTime] + # @return [DateTime] The date and time the transcript was created attr_reader :created - # @return [DateTime] + # @return [DateTime] The date and time the transcript was completed attr_reader :completed - # @return [String] + # @return [String] The URL to the audio file attr_reader :audio_url # @return [String] Error message of why the transcript failed attr_reader :error @@ -30,12 +30,12 @@ class TranscriptListItem OMIT = Object.new - # @param id [String] - # @param resource_url [String] - # @param status [AssemblyAI::Transcripts::TranscriptStatus] - # @param created [DateTime] - # @param completed [DateTime] - # @param audio_url [String] + # @param id [String] The unique identifier for the transcript + # @param resource_url [String] The URL to retrieve the transcript + # @param status [AssemblyAI::Transcripts::TranscriptStatus] The status of the transcript + # @param created [DateTime] The date and time the transcript was created + # @param completed [DateTime] The date and time the transcript was completed + # @param audio_url [String] The URL to the audio file # @param error [String] Error message of why the transcript failed # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TranscriptListItem] diff --git a/lib/assemblyai/transcripts/types/transcript_optional_params.rb b/lib/assemblyai/transcripts/types/transcript_optional_params.rb index 60eedb0..51c503e 100644 --- a/lib/assemblyai/transcripts/types/transcript_optional_params.rb +++ b/lib/assemblyai/transcripts/types/transcript_optional_params.rb @@ -34,13 +34,18 @@ class TranscriptOptionalParams attr_reader :format_text # @return [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false attr_reader :disfluencies + # @return [Boolean] Enable + # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) + # transcription, can be true or false. + attr_reader :multichannel # @return [Boolean] Enable [Dual # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) # transcription, can be true or false. attr_reader :dual_channel - # @return [String] The URL to which we send webhook requests. We sends two different types of - # webhook requests. One request when a transcript is completed or failed, and one - # request when the redacted audio is ready if redact_pii_audio is enabled. + # @return [String] The URL to which we send webhook requests. + # We sends two different types of webhook requests. + # One request when a transcript is completed or failed, and one request when the + # redacted audio is ready if redact_pii_audio is enabled. attr_reader :webhook_url # @return [String] The header name to be sent with the transcript completed or failed webhook # requests @@ -145,12 +150,16 @@ class TranscriptOptionalParams # @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false # @param format_text [Boolean] Enable Text Formatting, can be true or false # @param disfluencies [Boolean] Transcribe Filler Words, like "umm", in your media file; can be true or false + # @param multichannel [Boolean] Enable + # ://www.assemblyai.com/docs/models/speech-recognition#multichannel-transcription) + # transcription, can be true or false. # @param dual_channel [Boolean] Enable [Dual # ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription) # transcription, can be true or false. - # @param webhook_url [String] The URL to which we send webhook requests. We sends two different types of - # webhook requests. One request when a transcript is completed or failed, and one - # request when the redacted audio is ready if redact_pii_audio is enabled. + # @param webhook_url [String] The URL to which we send webhook requests. + # We sends two different types of webhook requests. + # One request when a transcript is completed or failed, and one request when the + # redacted audio is ready if redact_pii_audio is enabled. # @param webhook_auth_header_name [String] The header name to be sent with the transcript completed or failed webhook # requests # @param webhook_auth_header_value [String] The header value to send back with the transcript completed or failed webhook @@ -210,7 +219,7 @@ class TranscriptOptionalParams # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TranscriptOptionalParams] def initialize(language_code: OMIT, language_detection: OMIT, language_confidence_threshold: OMIT, - 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) + speech_model: OMIT, punctuate: OMIT, format_text: OMIT, disfluencies: OMIT, multichannel: OMIT, dual_channel: OMIT, webhook_url: OMIT, webhook_auth_header_name: OMIT, webhook_auth_header_value: OMIT, auto_highlights: OMIT, audio_start_from: OMIT, audio_end_at: OMIT, word_boost: OMIT, boost_param: OMIT, filter_profanity: OMIT, redact_pii: OMIT, redact_pii_audio: OMIT, redact_pii_audio_quality: OMIT, redact_pii_policies: OMIT, redact_pii_sub: OMIT, speaker_labels: OMIT, speakers_expected: OMIT, content_safety: OMIT, content_safety_confidence: OMIT, iab_categories: OMIT, custom_spelling: OMIT, sentiment_analysis: OMIT, auto_chapters: OMIT, entity_detection: OMIT, speech_threshold: OMIT, summarization: OMIT, summary_model: OMIT, summary_type: OMIT, custom_topics: OMIT, topics: OMIT, additional_properties: nil) @language_code = language_code if language_code != OMIT @language_detection = language_detection if language_detection != OMIT @language_confidence_threshold = language_confidence_threshold if language_confidence_threshold != OMIT @@ -218,6 +227,7 @@ def initialize(language_code: OMIT, language_detection: OMIT, language_confidenc @punctuate = punctuate if punctuate != OMIT @format_text = format_text if format_text != OMIT @disfluencies = disfluencies if disfluencies != OMIT + @multichannel = multichannel if multichannel != OMIT @dual_channel = dual_channel if dual_channel != OMIT @webhook_url = webhook_url if webhook_url != OMIT @webhook_auth_header_name = webhook_auth_header_name if webhook_auth_header_name != OMIT @@ -257,6 +267,7 @@ def initialize(language_code: OMIT, language_detection: OMIT, language_confidenc "punctuate": punctuate, "format_text": format_text, "disfluencies": disfluencies, + "multichannel": multichannel, "dual_channel": dual_channel, "webhook_url": webhook_url, "webhook_auth_header_name": webhook_auth_header_name, @@ -306,6 +317,7 @@ def self.from_json(json_object:) punctuate = struct["punctuate"] format_text = struct["format_text"] disfluencies = struct["disfluencies"] + multichannel = struct["multichannel"] dual_channel = struct["dual_channel"] webhook_url = struct["webhook_url"] webhook_auth_header_name = struct["webhook_auth_header_name"] @@ -347,6 +359,7 @@ def self.from_json(json_object:) punctuate: punctuate, format_text: format_text, disfluencies: disfluencies, + multichannel: multichannel, dual_channel: dual_channel, webhook_url: webhook_url, webhook_auth_header_name: webhook_auth_header_name, @@ -402,6 +415,7 @@ def self.validate_raw(obj:) obj.punctuate&.is_a?(Boolean) != false || raise("Passed value for field obj.punctuate is not the expected type, validation failed.") obj.format_text&.is_a?(Boolean) != false || raise("Passed value for field obj.format_text is not the expected type, validation failed.") obj.disfluencies&.is_a?(Boolean) != false || raise("Passed value for field obj.disfluencies is not the expected type, validation failed.") + obj.multichannel&.is_a?(Boolean) != false || raise("Passed value for field obj.multichannel is not the expected type, validation failed.") obj.dual_channel&.is_a?(Boolean) != false || raise("Passed value for field obj.dual_channel is not the expected type, validation failed.") obj.webhook_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_url is not the expected type, validation failed.") obj.webhook_auth_header_name&.is_a?(String) != false || raise("Passed value for field obj.webhook_auth_header_name is not the expected type, validation failed.") diff --git a/lib/assemblyai/transcripts/types/transcript_paragraph.rb b/lib/assemblyai/transcripts/types/transcript_paragraph.rb index 4649c9b..3633e89 100644 --- a/lib/assemblyai/transcripts/types/transcript_paragraph.rb +++ b/lib/assemblyai/transcripts/types/transcript_paragraph.rb @@ -7,20 +7,16 @@ module AssemblyAI class Transcripts class TranscriptParagraph - # @return [String] + # @return [String] The transcript of the paragraph attr_reader :text - # @return [Integer] + # @return [Integer] The starting time, in milliseconds, of the paragraph attr_reader :start - # @return [Integer] + # @return [Integer] The ending time, in milliseconds, of the paragraph attr_reader :end_ - # @return [Float] + # @return [Float] The confidence score for the transcript of this paragraph attr_reader :confidence - # @return [Array] + # @return [Array] An array of words in the paragraph attr_reader :words - # @return [String] The speaker of the sentence if [Speaker - # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is - # enabled, else null - attr_reader :speaker # @return [OpenStruct] Additional properties unmapped to the current class definition attr_reader :additional_properties # @return [Object] @@ -29,34 +25,21 @@ class TranscriptParagraph OMIT = Object.new - # @param text [String] - # @param start [Integer] - # @param end_ [Integer] - # @param confidence [Float] - # @param words [Array] - # @param speaker [String] The speaker of the sentence if [Speaker - # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is - # enabled, else null + # @param text [String] The transcript of the paragraph + # @param start [Integer] The starting time, in milliseconds, of the paragraph + # @param end_ [Integer] The ending time, in milliseconds, of the paragraph + # @param confidence [Float] The confidence score for the transcript of this paragraph + # @param words [Array] An array of words in the paragraph # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TranscriptParagraph] - def initialize(text:, start:, end_:, confidence:, words:, speaker: OMIT, additional_properties: nil) + def initialize(text:, start:, end_:, confidence:, words:, additional_properties: nil) @text = text @start = start @end_ = end_ @confidence = confidence @words = words - @speaker = speaker if speaker != OMIT @additional_properties = additional_properties - @_field_set = { - "text": text, - "start": start, - "end": end_, - "confidence": confidence, - "words": words, - "speaker": speaker - }.reject do |_k, v| - v == OMIT - end + @_field_set = { "text": text, "start": start, "end": end_, "confidence": confidence, "words": words } end # Deserialize a JSON object to an instance of TranscriptParagraph @@ -74,14 +57,12 @@ def self.from_json(json_object:) v = v.to_json AssemblyAI::Transcripts::TranscriptWord.from_json(json_object: v) end - speaker = struct["speaker"] new( text: text, start: start, end_: end_, confidence: confidence, words: words, - speaker: speaker, additional_properties: struct ) end @@ -105,7 +86,6 @@ def self.validate_raw(obj:) obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.") obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.") obj.words.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.") - obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.") end end end diff --git a/lib/assemblyai/transcripts/types/transcript_sentence.rb b/lib/assemblyai/transcripts/types/transcript_sentence.rb index 867db3f..3c052a5 100644 --- a/lib/assemblyai/transcripts/types/transcript_sentence.rb +++ b/lib/assemblyai/transcripts/types/transcript_sentence.rb @@ -7,16 +7,19 @@ module AssemblyAI class Transcripts class TranscriptSentence - # @return [String] + # @return [String] The transcript of the sentence attr_reader :text - # @return [Integer] + # @return [Integer] The starting time, in milliseconds, for the sentence attr_reader :start - # @return [Integer] + # @return [Integer] The ending time, in milliseconds, for the sentence attr_reader :end_ - # @return [Float] + # @return [Float] The confidence score for the transcript of this sentence attr_reader :confidence - # @return [Array] + # @return [Array] An array of words in the sentence attr_reader :words + # @return [String] The channel of the sentence. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. + attr_reader :channel # @return [String] The speaker of the sentence if [Speaker # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is # enabled, else null @@ -29,22 +32,26 @@ class TranscriptSentence OMIT = Object.new - # @param text [String] - # @param start [Integer] - # @param end_ [Integer] - # @param confidence [Float] - # @param words [Array] + # @param text [String] The transcript of the sentence + # @param start [Integer] The starting time, in milliseconds, for the sentence + # @param end_ [Integer] The ending time, in milliseconds, for the sentence + # @param confidence [Float] The confidence score for the transcript of this sentence + # @param words [Array] An array of words in the sentence + # @param channel [String] The channel of the sentence. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. # @param speaker [String] The speaker of the sentence if [Speaker # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is # enabled, else null # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TranscriptSentence] - def initialize(text:, start:, end_:, confidence:, words:, speaker: OMIT, additional_properties: nil) + def initialize(text:, start:, end_:, confidence:, words:, channel: OMIT, speaker: OMIT, + additional_properties: nil) @text = text @start = start @end_ = end_ @confidence = confidence @words = words + @channel = channel if channel != OMIT @speaker = speaker if speaker != OMIT @additional_properties = additional_properties @_field_set = { @@ -53,6 +60,7 @@ def initialize(text:, start:, end_:, confidence:, words:, speaker: OMIT, additio "end": end_, "confidence": confidence, "words": words, + "channel": channel, "speaker": speaker }.reject do |_k, v| v == OMIT @@ -74,6 +82,7 @@ def self.from_json(json_object:) v = v.to_json AssemblyAI::Transcripts::TranscriptWord.from_json(json_object: v) end + channel = struct["channel"] speaker = struct["speaker"] new( text: text, @@ -81,6 +90,7 @@ def self.from_json(json_object:) end_: end_, confidence: confidence, words: words, + channel: channel, speaker: speaker, additional_properties: struct ) @@ -105,6 +115,7 @@ def self.validate_raw(obj:) obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.") obj.confidence.is_a?(Float) != false || raise("Passed value for field obj.confidence is not the expected type, validation failed.") obj.words.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.") + obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.") obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.") end end diff --git a/lib/assemblyai/transcripts/types/transcript_utterance.rb b/lib/assemblyai/transcripts/types/transcript_utterance.rb index a39cf54..fadc0f1 100644 --- a/lib/assemblyai/transcripts/types/transcript_utterance.rb +++ b/lib/assemblyai/transcripts/types/transcript_utterance.rb @@ -17,6 +17,9 @@ class TranscriptUtterance attr_reader :text # @return [Array] The words in the utterance. attr_reader :words + # @return [String] The channel of this utterance. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. + attr_reader :channel # @return [String] The speaker of this utterance, where each speaker is assigned a sequential # capital letter - e.g. "A" for Speaker A, "B" for Speaker B, etc. attr_reader :speaker @@ -33,16 +36,19 @@ class TranscriptUtterance # @param end_ [Integer] The ending time, in milliseconds, of the utterance in the audio file # @param text [String] The text for this utterance # @param words [Array] The words in the utterance. + # @param channel [String] The channel of this utterance. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. # @param speaker [String] The speaker of this utterance, where each speaker is assigned a sequential # capital letter - e.g. "A" for Speaker A, "B" for Speaker B, etc. # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TranscriptUtterance] - def initialize(confidence:, start:, end_:, text:, words:, speaker:, additional_properties: nil) + def initialize(confidence:, start:, end_:, text:, words:, speaker:, channel: OMIT, additional_properties: nil) @confidence = confidence @start = start @end_ = end_ @text = text @words = words + @channel = channel if channel != OMIT @speaker = speaker @additional_properties = additional_properties @_field_set = { @@ -51,8 +57,11 @@ def initialize(confidence:, start:, end_:, text:, words:, speaker:, additional_p "end": end_, "text": text, "words": words, + "channel": channel, "speaker": speaker - } + }.reject do |_k, v| + v == OMIT + end end # Deserialize a JSON object to an instance of TranscriptUtterance @@ -70,6 +79,7 @@ def self.from_json(json_object:) v = v.to_json AssemblyAI::Transcripts::TranscriptWord.from_json(json_object: v) end + channel = struct["channel"] speaker = struct["speaker"] new( confidence: confidence, @@ -77,6 +87,7 @@ def self.from_json(json_object:) end_: end_, text: text, words: words, + channel: channel, speaker: speaker, additional_properties: struct ) @@ -101,6 +112,7 @@ def self.validate_raw(obj:) obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.") obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.") obj.words.is_a?(Array) != false || raise("Passed value for field obj.words is not the expected type, validation failed.") + obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.") obj.speaker.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.") end end diff --git a/lib/assemblyai/transcripts/types/transcript_word.rb b/lib/assemblyai/transcripts/types/transcript_word.rb index 8c70991..7c53047 100644 --- a/lib/assemblyai/transcripts/types/transcript_word.rb +++ b/lib/assemblyai/transcripts/types/transcript_word.rb @@ -6,15 +6,18 @@ module AssemblyAI class Transcripts class TranscriptWord - # @return [Float] + # @return [Float] The confidence score for the transcript of this word attr_reader :confidence - # @return [Integer] + # @return [Integer] The starting time, in milliseconds, for the word attr_reader :start - # @return [Integer] + # @return [Integer] The ending time, in milliseconds, for the word attr_reader :end_ - # @return [String] + # @return [String] The text of the word attr_reader :text - # @return [String] The speaker of the sentence if [Speaker + # @return [String] The channel of the word. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. + attr_reader :channel + # @return [String] The speaker of the word if [Speaker # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is # enabled, else null attr_reader :speaker @@ -26,20 +29,23 @@ class TranscriptWord OMIT = Object.new - # @param confidence [Float] - # @param start [Integer] - # @param end_ [Integer] - # @param text [String] - # @param speaker [String] The speaker of the sentence if [Speaker + # @param confidence [Float] The confidence score for the transcript of this word + # @param start [Integer] The starting time, in milliseconds, for the word + # @param end_ [Integer] The ending time, in milliseconds, for the word + # @param text [String] The text of the word + # @param channel [String] The channel of the word. The left and right channels are channels 1 and 2. + # Additional channels increment the channel number sequentially. + # @param speaker [String] The speaker of the word if [Speaker # Diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is # enabled, else null # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition # @return [AssemblyAI::Transcripts::TranscriptWord] - def initialize(confidence:, start:, end_:, text:, speaker: OMIT, additional_properties: nil) + def initialize(confidence:, start:, end_:, text:, channel: OMIT, speaker: OMIT, additional_properties: nil) @confidence = confidence @start = start @end_ = end_ @text = text + @channel = channel if channel != OMIT @speaker = speaker if speaker != OMIT @additional_properties = additional_properties @_field_set = { @@ -47,6 +53,7 @@ def initialize(confidence:, start:, end_:, text:, speaker: OMIT, additional_prop "start": start, "end": end_, "text": text, + "channel": channel, "speaker": speaker }.reject do |_k, v| v == OMIT @@ -63,12 +70,14 @@ def self.from_json(json_object:) start = struct["start"] end_ = struct["end"] text = struct["text"] + channel = struct["channel"] speaker = struct["speaker"] new( confidence: confidence, start: start, end_: end_, text: text, + channel: channel, speaker: speaker, additional_properties: struct ) @@ -92,6 +101,7 @@ def self.validate_raw(obj:) obj.start.is_a?(Integer) != false || raise("Passed value for field obj.start is not the expected type, validation failed.") obj.end_.is_a?(Integer) != false || raise("Passed value for field obj.end_ is not the expected type, validation failed.") obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.") + obj.channel&.is_a?(String) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.") obj.speaker&.is_a?(String) != false || raise("Passed value for field obj.speaker is not the expected type, validation failed.") end end