Skip to content

Commit

Permalink
Merge pull request #30 from AssemblyAI/fern-bot/05-30-2024-0910PM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- May 30, 2024
  • Loading branch information
Swimburger authored May 30, 2024
2 parents 9723f39 + 1a45127 commit 2435c6a
Show file tree
Hide file tree
Showing 22 changed files with 155 additions and 64 deletions.
2 changes: 1 addition & 1 deletion assemblyai.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require_relative "lib/gemconfig"

Gem::Specification.new do |spec|
spec.name = "assemblyai"
spec.version = "1.0.0-beta.8"
spec.version = "1.0.0-beta.9"
spec.authors = AssemblyAI::Gemconfig::AUTHORS
spec.email = AssemblyAI::Gemconfig::EMAIL
spec.summary = AssemblyAI::Gemconfig::SUMMARY
Expand Down
24 changes: 14 additions & 10 deletions lib/assemblyai/lemur/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_mode
end

# Custom Summary allows you to distill a piece of audio into a few impactful
# sentences. You can give the model context to obtain more targeted results while
# outputting the results in a variety of formats described in human language.
# sentences.
# You can give the model context to obtain more targeted results while outputting
# the results in a variety of formats described in human language.
#
# @param transcript_ids [Array<String>] A list of completed transcripts with text. Up to a maximum of 100 files or 100
# hours, whichever is lower.
Expand Down Expand Up @@ -121,9 +122,10 @@ def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil
end

# Question & Answer allows you to ask free-form questions about a single
# transcript or a group of transcripts. The questions can be any whose answers you
# find useful, such as judging whether a caller is likely to become a customer or
# whether all items on a meeting's agenda were covered.
# transcript or a group of transcripts.
# The questions can be any whose answers you find useful, such as judging whether
# a caller is likely to become a customer or whether all items on a meeting's
# agenda were covered.
#
# @param transcript_ids [Array<String>] A list of completed transcripts with text. Up to a maximum of 100 files or 100
# hours, whichever is lower.
Expand Down Expand Up @@ -309,8 +311,9 @@ def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_mode
end

# Custom Summary allows you to distill a piece of audio into a few impactful
# sentences. You can give the model context to obtain more targeted results while
# outputting the results in a variety of formats described in human language.
# sentences.
# You can give the model context to obtain more targeted results while outputting
# the results in a variety of formats described in human language.
#
# @param transcript_ids [Array<String>] A list of completed transcripts with text. Up to a maximum of 100 files or 100
# hours, whichever is lower.
Expand Down Expand Up @@ -361,9 +364,10 @@ def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil
end

# Question & Answer allows you to ask free-form questions about a single
# transcript or a group of transcripts. The questions can be any whose answers you
# find useful, such as judging whether a caller is likely to become a customer or
# whether all items on a meeting's agenda were covered.
# transcript or a group of transcripts.
# The questions can be any whose answers you find useful, such as judging whether
# a caller is likely to become a customer or whether all items on a meeting's
# agenda were covered.
#
# @param transcript_ids [Array<String>] A list of completed transcripts with text. Up to a maximum of 100 files or 100
# hours, whichever is lower.
Expand Down
1 change: 0 additions & 1 deletion lib/assemblyai/lemur/types/lemur_base_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def initialize(transcript_ids: OMIT, input_text: OMIT, context: OMIT, final_mode
# @return [AssemblyAI::Lemur::LemurBaseParams]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
transcript_ids = struct["transcript_ids"]
input_text = struct["input_text"]
if parsed_json["context"].nil?
Expand Down
1 change: 0 additions & 1 deletion lib/assemblyai/lemur/types/lemur_question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def initialize(question:, context: OMIT, answer_format: OMIT, answer_options: OM
# @return [AssemblyAI::Lemur::LemurQuestion]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
question = struct["question"]
if parsed_json["context"].nil?
context = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def initialize(response:, request_id:, additional_properties: nil)
# @return [AssemblyAI::Lemur::LemurQuestionAnswerResponse]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
response = parsed_json["response"]&.map do |v|
v = v.to_json
AssemblyAI::Lemur::LemurQuestionAnswer.from_json(json_object: v)
Expand Down
4 changes: 2 additions & 2 deletions lib/assemblyai/realtime/types/final_transcript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
module AssemblyAI
class Realtime
class FinalTranscript
# @return [String]
# @return [String] Describes the type of message
attr_reader :message_type
# @return [Boolean] Whether the text is punctuated and cased
attr_reader :punctuated
Expand Down Expand Up @@ -37,7 +37,7 @@ class FinalTranscript

OMIT = Object.new

# @param message_type [String]
# @param message_type [String] Describes the type of message
# @param punctuated [Boolean] Whether the text is punctuated and cased
# @param text_formatted [Boolean] Whether the text is formatted, for example Dollar -> $
# @param audio_start [Integer] Start time of audio sample relative to session start, in milliseconds
Expand Down
4 changes: 2 additions & 2 deletions lib/assemblyai/realtime/types/partial_transcript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
module AssemblyAI
class Realtime
class PartialTranscript
# @return [String]
# @return [String] Describes the type of message
attr_reader :message_type
# @return [Integer] Start time of audio sample relative to session start, in milliseconds
attr_reader :audio_start
Expand All @@ -33,7 +33,7 @@ class PartialTranscript

OMIT = Object.new

# @param message_type [String]
# @param message_type [String] Describes the type of message
# @param audio_start [Integer] Start time of audio sample relative to session start, in milliseconds
# @param audio_end [Integer] End time of audio sample relative to session start, in milliseconds
# @param confidence [Float] The confidence score of the entire transcription, between 0 and 1
Expand Down
4 changes: 2 additions & 2 deletions lib/assemblyai/realtime/types/session_begins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module AssemblyAI
class Realtime
class SessionBegins
# @return [String]
# @return [String] Describes the type of the message
attr_reader :message_type
# @return [String] Unique identifier for the established session
attr_reader :session_id
Expand All @@ -21,7 +21,7 @@ class SessionBegins

OMIT = Object.new

# @param message_type [String]
# @param message_type [String] Describes the type of the message
# @param session_id [String] Unique identifier for the established session
# @param expires_at [DateTime] Timestamp when this session will expire
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
Expand Down
4 changes: 2 additions & 2 deletions lib/assemblyai/realtime/types/session_information.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Realtime
# This message is sent at the end of the session, before the SessionTerminated
# message.
class SessionInformation
# @return [String]
# @return [String] Describes the type of the message
attr_reader :message_type
# @return [Float] The total duration of the audio in seconds
attr_reader :audio_duration_seconds
Expand All @@ -21,7 +21,7 @@ class SessionInformation

OMIT = Object.new

# @param message_type [String]
# @param message_type [String] Describes the type of the message
# @param audio_duration_seconds [Float] The total duration of the audio in seconds
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [AssemblyAI::Realtime::SessionInformation]
Expand Down
4 changes: 2 additions & 2 deletions lib/assemblyai/realtime/types/session_terminated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module AssemblyAI
class Realtime
class SessionTerminated
# @return [String]
# @return [String] Describes the type of the message
attr_reader :message_type
# @return [OpenStruct] Additional properties unmapped to the current class definition
attr_reader :additional_properties
Expand All @@ -16,7 +16,7 @@ class SessionTerminated

OMIT = Object.new

# @param message_type [String]
# @param message_type [String] Describes the type of the message
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
# @return [AssemblyAI::Realtime::SessionTerminated]
def initialize(message_type:, additional_properties: nil)
Expand Down
15 changes: 15 additions & 0 deletions lib/assemblyai/transcripts/types/entity_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,50 @@ module AssemblyAI
class Transcripts
# The type of entity for the detected entity
class EntityType
ACCOUNT_NUMBER = "account_number"
BANKING_INFORMATION = "banking_information"
BLOOD_TYPE = "blood_type"
CREDIT_CARD_CVV = "credit_card_cvv"
CREDIT_CARD_EXPIRATION = "credit_card_expiration"
CREDIT_CARD_NUMBER = "credit_card_number"
DATE = "date"
DATE_INTERVAL = "date_interval"
DATE_OF_BIRTH = "date_of_birth"
DRIVERS_LICENSE = "drivers_license"
DRUG = "drug"
DURATION = "duration"
EMAIL_ADDRESS = "email_address"
EVENT = "event"
FILENAME = "filename"
GENDER_SEXUALITY = "gender_sexuality"
HEALTHCARE_NUMBER = "healthcare_number"
INJURY = "injury"
IP_ADDRESS = "ip_address"
LANGUAGE = "language"
LOCATION = "location"
MARITAL_STATUS = "marital_status"
MEDICAL_CONDITION = "medical_condition"
MEDICAL_PROCESS = "medical_process"
MONEY_AMOUNT = "money_amount"
NATIONALITY = "nationality"
NUMBER_SEQUENCE = "number_sequence"
OCCUPATION = "occupation"
ORGANIZATION = "organization"
PASSPORT_NUMBER = "passport_number"
PASSWORD = "password"
PERSON_AGE = "person_age"
PERSON_NAME = "person_name"
PHONE_NUMBER = "phone_number"
PHYSICAL_ATTRIBUTE = "physical_attribute"
POLITICAL_AFFILIATION = "political_affiliation"
RELIGION = "religion"
STATISTICS = "statistics"
TIME = "time"
URL = "url"
US_SOCIAL_SECURITY_NUMBER = "us_social_security_number"
USERNAME = "username"
VEHICLE_ID = "vehicle_id"
ZODIAC_SIGN = "zodiac_sign"
end
end
end
12 changes: 6 additions & 6 deletions lib/assemblyai/transcripts/types/page_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class Transcripts
# Details of the transcript page. Transcripts are sorted from newest to oldest.
# The previous URL always points to a page with older transcripts.
class PageDetails
# @return [Integer]
# @return [Integer] The number of results this page is limited to
attr_reader :limit
# @return [Integer]
# @return [Integer] The actual number of results in the page
attr_reader :result_count
# @return [String]
# @return [String] The URL used to retrieve the current page of transcripts
attr_reader :current_url
# @return [String] The URL to the next page of transcripts. The previous URL always points to a
# page with older transcripts.
Expand All @@ -28,9 +28,9 @@ class PageDetails

OMIT = Object.new

# @param limit [Integer]
# @param result_count [Integer]
# @param current_url [String]
# @param limit [Integer] The number of results this page is limited to
# @param result_count [Integer] The actual number of results in the page
# @param current_url [String] The URL used to retrieve the current page of transcripts
# @param prev_url [String] The URL to the next page of transcripts. The previous URL always points to a
# page with older transcripts.
# @param next_url [String] The URL to the next page of transcripts. The next URL always points to a page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

module AssemblyAI
class Transcripts
# The result of the sentiment analysis model
# The result of the Sentiment Analysis model
class SentimentAnalysisResult
# @return [String] The transcript of the sentence
attr_reader :text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def initialize(status:, results:, summary:, additional_properties: nil)
# @return [AssemblyAI::Transcripts::TopicDetectionModelResult]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
status = struct["status"]
results = parsed_json["results"]&.map do |v|
v = v.to_json
Expand Down
9 changes: 4 additions & 5 deletions lib/assemblyai/transcripts/types/transcript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Transcript
attr_reader :dual_channel
# @return [AssemblyAI::Transcripts::SpeechModel]
attr_reader :speech_model
# @return [String] The URL to which we send webhooks upon trancription completion
# @return [String] The URL to which we send webhooks upon transcription completion
attr_reader :webhook_url
# @return [Integer] The status code we received from your server when delivering your webhook, if a
# webhook URL was provided
Expand Down Expand Up @@ -172,7 +172,7 @@ class Transcript
attr_reader :sentiment_analysis
# @return [Array<AssemblyAI::Transcripts::SentimentAnalysisResult>] An array of results for the Sentiment Analysis model, if it is enabled.
# See [Sentiment
# analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) for more
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) for more
# information.
attr_reader :sentiment_analysis_results
# @return [Boolean] Whether [Entity
Expand Down Expand Up @@ -230,7 +230,7 @@ class Transcript
# ://www.assemblyai.com/docs/models/speech-recognition#dual-channel-transcription)
# was enabled in the transcription request, either true or false
# @param speech_model [AssemblyAI::Transcripts::SpeechModel]
# @param webhook_url [String] The URL to which we send webhooks upon trancription completion
# @param webhook_url [String] The URL to which we send webhooks upon transcription completion
# @param webhook_status_code [Integer] The status code we received from your server when delivering your webhook, if a
# webhook URL was provided
# @param webhook_auth [Boolean] Whether webhook authentication details were provided
Expand Down Expand Up @@ -300,7 +300,7 @@ class Transcript
# can be true or false
# @param sentiment_analysis_results [Array<AssemblyAI::Transcripts::SentimentAnalysisResult>] An array of results for the Sentiment Analysis model, if it is enabled.
# See [Sentiment
# analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) for more
# Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) for more
# information.
# @param entity_detection [Boolean] Whether [Entity
# Detection](https://www.assemblyai.com/docs/models/entity-detection) is enabled,
Expand Down Expand Up @@ -443,7 +443,6 @@ def initialize(id:, language_model:, acoustic_model:, status:, audio_url:, webho
# @return [AssemblyAI::Transcripts::Transcript]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
id = struct["id"]
language_model = struct["language_model"]
acoustic_model = struct["acoustic_model"]
Expand Down
Loading

0 comments on commit 2435c6a

Please sign in to comment.