Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Oct 17, 2024
1 parent fc85760 commit 32203ad
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 114 deletions.
2 changes: 1 addition & 1 deletion lib/assemblyai/lemur/types/lemur_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
30 changes: 20 additions & 10 deletions lib/assemblyai/transcripts/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AssemblyAI::Transcripts::ContentSafetyLabelResult>]
# @return [Array<AssemblyAI::Transcripts::ContentSafetyLabelResult>] 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
Expand All @@ -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<AssemblyAI::Transcripts::ContentSafetyLabelResult>]
# @param results [Array<AssemblyAI::Transcripts::ContentSafetyLabelResult>] 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
Expand Down
16 changes: 8 additions & 8 deletions lib/assemblyai/transcripts/types/paragraphs_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<AssemblyAI::Transcripts::TranscriptParagraph>]
# @return [Array<AssemblyAI::Transcripts::TranscriptParagraph>] An array of paragraphs in the transcript
attr_reader :paragraphs
# @return [OpenStruct] Additional properties unmapped to the current class definition
attr_reader :additional_properties
Expand All @@ -23,10 +23,10 @@ class ParagraphsResponse

OMIT = Object.new

# @param id [String]
# @param confidence [Float]
# @param audio_duration [Float]
# @param paragraphs [Array<AssemblyAI::Transcripts::TranscriptParagraph>]
# @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<AssemblyAI::Transcripts::TranscriptParagraph>] 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)
Expand Down
16 changes: 8 additions & 8 deletions lib/assemblyai/transcripts/types/sentences_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<AssemblyAI::Transcripts::TranscriptSentence>]
# @return [Array<AssemblyAI::Transcripts::TranscriptSentence>] An array of sentences in the transcript
attr_reader :sentences
# @return [OpenStruct] Additional properties unmapped to the current class definition
attr_reader :additional_properties
Expand All @@ -23,10 +23,10 @@ class SentencesResponse

OMIT = Object.new

# @param id [String]
# @param confidence [Float]
# @param audio_duration [Float]
# @param sentences [Array<AssemblyAI::Transcripts::TranscriptSentence>]
# @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<AssemblyAI::Transcripts::TranscriptSentence>] 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)
Expand Down
13 changes: 12 additions & 1 deletion lib/assemblyai/transcripts/types/sentiment_analysis_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {
Expand All @@ -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
Expand All @@ -71,13 +79,15 @@ def self.from_json(json_object:)
end_ = struct["end"]
sentiment = struct["sentiment"]
confidence = struct["confidence"]
channel = struct["channel"]
speaker = struct["speaker"]
new(
text: text,
start: start,
end_: end_,
sentiment: sentiment,
confidence: confidence,
channel: channel,
speaker: speaker,
additional_properties: struct
)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/assemblyai/transcripts/types/topic_detection_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>]
# @return [Array<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>] An array of detected topics in the text
attr_reader :labels
# @return [AssemblyAI::Transcripts::Timestamp]
attr_reader :timestamp
Expand All @@ -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<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>]
# @param labels [Array<AssemblyAI::Transcripts::TopicDetectionResultLabelsItem>] 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]
Expand Down
Loading

0 comments on commit 32203ad

Please sign in to comment.