Skip to content

Commit

Permalink
🌿 Fern Regeneration -- June 5, 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo committed Jun 5, 2024
2 parents 2435c6a + ec3cf68 commit 03132e1
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 46 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.9"
spec.version = "1.0.0-beta.10"
spec.authors = AssemblyAI::Gemconfig::AUTHORS
spec.email = AssemblyAI::Gemconfig::EMAIL
spec.summary = AssemblyAI::Gemconfig::SUMMARY
Expand Down
40 changes: 20 additions & 20 deletions lib/assemblyai/lemur/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def initialize(request_client:)
# @return [AssemblyAI::Lemur::LemurTaskResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.task(prompt: "List all the locations affected by wildfires.")
# api.lemur.task(prompt: "List all the locations affected by wildfires.")
def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, request_options: nil)
response = @request_client.conn.post do |req|
Expand Down Expand Up @@ -95,11 +95,11 @@ def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_mode
# @return [AssemblyAI::Lemur::LemurSummaryResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.summary
# api.lemur.summary
def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, answer_format: nil, request_options: nil)
response = @request_client.conn.post do |req|
Expand Down Expand Up @@ -150,11 +150,11 @@ def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil
# @return [AssemblyAI::Lemur::LemurQuestionAnswerResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
# api.lemur.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
def question_answer(questions:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, request_options: nil)
response = @request_client.conn.post do |req|
Expand Down Expand Up @@ -198,11 +198,11 @@ def question_answer(questions:, transcript_ids: nil, input_text: nil, context: n
# @return [AssemblyAI::Lemur::LemurActionItemsResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.action_items(answer_format: "Bullet Points")
# api.lemur.action_items(answer_format: "Bullet Points")
def action_items(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, answer_format: nil, request_options: nil)
response = @request_client.conn.post do |req|
Expand Down Expand Up @@ -234,11 +234,11 @@ def action_items(transcript_ids: nil, input_text: nil, context: nil, final_model
# @return [AssemblyAI::Lemur::PurgeLemurRequestDataResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.purge_request_data(request_id: "request_id")
# api.lemur.purge_request_data(request_id: "request_id")
def purge_request_data(request_id:, request_options: nil)
response = @request_client.conn.delete do |req|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
Expand Down Expand Up @@ -282,11 +282,11 @@ def initialize(request_client:)
# @return [AssemblyAI::Lemur::LemurTaskResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.task(prompt: "List all the locations affected by wildfires.")
# api.lemur.task(prompt: "List all the locations affected by wildfires.")
def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, request_options: nil)
Async do
Expand Down Expand Up @@ -335,11 +335,11 @@ def task(prompt:, transcript_ids: nil, input_text: nil, context: nil, final_mode
# @return [AssemblyAI::Lemur::LemurSummaryResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.summary
# api.lemur.summary
def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, answer_format: nil, request_options: nil)
Async do
Expand Down Expand Up @@ -392,11 +392,11 @@ def summary(transcript_ids: nil, input_text: nil, context: nil, final_model: nil
# @return [AssemblyAI::Lemur::LemurQuestionAnswerResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
# api.lemur.question_answer(questions: [{ question: "Where are there wildfires?", answer_format: "List of countries in ISO 3166-1 alpha-2 format", answer_options: ["US", "CA"] }, { question: "Is global warming affecting wildfires?", answer_options: ["yes", "no"] }])
def question_answer(questions:, transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, request_options: nil)
Async do
Expand Down Expand Up @@ -442,11 +442,11 @@ def question_answer(questions:, transcript_ids: nil, input_text: nil, context: n
# @return [AssemblyAI::Lemur::LemurActionItemsResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.action_items(answer_format: "Bullet Points")
# api.lemur.action_items(answer_format: "Bullet Points")
def action_items(transcript_ids: nil, input_text: nil, context: nil, final_model: nil, max_output_size: nil,
temperature: nil, answer_format: nil, request_options: nil)
Async do
Expand Down Expand Up @@ -480,11 +480,11 @@ def action_items(transcript_ids: nil, input_text: nil, context: nil, final_model
# @return [AssemblyAI::Lemur::PurgeLemurRequestDataResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.purge_request_data(request_id: "request_id")
# api.lemur.purge_request_data(request_id: "request_id")
def purge_request_data(request_id:, request_options: nil)
Async do
response = @request_client.conn.delete do |req|
Expand Down
1 change: 1 addition & 0 deletions lib/assemblyai/lemur/types/lemur_base_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ 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: 1 addition & 0 deletions lib/assemblyai/lemur/types/lemur_question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ 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,6 +36,7 @@ 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
8 changes: 4 additions & 4 deletions lib/assemblyai/realtime/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def initialize(request_client:)
# @return [AssemblyAI::Realtime::RealtimeTemporaryTokenResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.create_temporary_token(expires_in: 480)
# api.realtime.create_temporary_token(expires_in: 480)
def create_temporary_token(expires_in:, 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?
Expand Down Expand Up @@ -56,11 +56,11 @@ def initialize(request_client:)
# @return [AssemblyAI::Realtime::RealtimeTemporaryTokenResponse]
# @example
# api = AssemblyAI::Client.new(
# environment: Environment::DEFAULT,
# environment: AssemblyAI::Environment::DEFAULT,
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.create_temporary_token(expires_in: 480)
# api.realtime.create_temporary_token(expires_in: 480)
def create_temporary_token(expires_in:, request_options: nil)
Async do
response = @request_client.conn.post do |req|
Expand Down
52 changes: 35 additions & 17 deletions lib/assemblyai/transcripts/types/pii_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,52 @@

module AssemblyAI
class Transcripts
# The type of PII to redact
class PiiPolicy
MEDICAL_PROCESS = "medical_process"
MEDICAL_CONDITION = "medical_condition"
ACCOUNT_NUMBER = "account_number"
BANKING_INFORMATION = "banking_information"
BLOOD_TYPE = "blood_type"
DRUG = "drug"
INJURY = "injury"
NUMBER_SEQUENCE = "number_sequence"
EMAIL_ADDRESS = "email_address"
DATE_OF_BIRTH = "date_of_birth"
PHONE_NUMBER = "phone_number"
US_SOCIAL_SECURITY_NUMBER = "us_social_security_number"
CREDIT_CARD_NUMBER = "credit_card_number"
CREDIT_CARD_EXPIRATION = "credit_card_expiration"
CREDIT_CARD_CVV = "credit_card_cvv"
CREDIT_CARD_EXPIRATION = "credit_card_expiration"
CREDIT_CARD_NUMBER = "credit_card_number"
DATE = "date"
NATIONALITY = "nationality"
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"
PERSON_NAME = "person_name"
PERSON_AGE = "person_age"
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"
OCCUPATION = "occupation"
RELIGION = "religion"
DRIVERS_LICENSE = "drivers_license"
BANKING_INFORMATION = "banking_information"
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ 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
1 change: 1 addition & 0 deletions lib/assemblyai/transcripts/types/transcript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ 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
1 change: 1 addition & 0 deletions lib/assemblyai/transcripts/types/transcript_list_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def initialize(id:, resource_url:, status:, created:, completed:, audio_url:, er
# @return [AssemblyAI::Transcripts::TranscriptListItem]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
id = struct["id"]
resource_url = struct["resource_url"]
status = struct["status"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def initialize(language_code: OMIT, punctuate: OMIT, format_text: OMIT, dual_cha
# @return [AssemblyAI::Transcripts::TranscriptOptionalParams]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
language_code = struct["language_code"]
punctuate = struct["punctuate"]
format_text = struct["format_text"]
Expand Down
1 change: 1 addition & 0 deletions lib/assemblyai/transcripts/types/transcript_paragraph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def initialize(text:, start:, end_:, confidence:, words:, speaker: OMIT, additio
# @return [AssemblyAI::Transcripts::TranscriptParagraph]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
text = struct["text"]
start = struct["start"]
end_ = struct["end"]
Expand Down
1 change: 1 addition & 0 deletions lib/assemblyai/transcripts/types/transcript_sentence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def initialize(text:, start:, end_:, confidence:, words:, speaker: OMIT, additio
# @return [AssemblyAI::Transcripts::TranscriptSentence]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
text = struct["text"]
start = struct["start"]
end_ = struct["end"]
Expand Down
1 change: 1 addition & 0 deletions lib/assemblyai/transcripts/types/transcript_utterance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def initialize(confidence:, start:, end_:, text:, words:, speaker:, additional_p
# @return [AssemblyAI::Transcripts::TranscriptUtterance]
def self.from_json(json_object:)
struct = JSON.parse(json_object, object_class: OpenStruct)
parsed_json = JSON.parse(json_object)
confidence = struct["confidence"]
start = struct["start"]
end_ = struct["end"]
Expand Down
8 changes: 4 additions & 4 deletions lib/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class RequestClient
# @param timeout_in_seconds [Long]
# @param api_key [String]
# @return [AssemblyAI::RequestClient]
def initialize(api_key:, environment: Environment::DEFAULT, base_url: nil, max_retries: nil,
def initialize(api_key:, environment: AssemblyAI::Environment::DEFAULT, base_url: nil, max_retries: nil,
timeout_in_seconds: nil)
@default_environment = environment
@base_url = environment || base_url
@headers = {
"X-Fern-Language": "Ruby",
"X-Fern-SDK-Name": "assemblyai",
"X-Fern-SDK-Version": "1.0.0-beta.9",
"X-Fern-SDK-Version": "1.0.0-beta.10",
"Authorization": api_key.to_s
}
@conn = Faraday.new(headers: @headers) do |faraday|
Expand Down Expand Up @@ -63,14 +63,14 @@ class AsyncRequestClient
# @param timeout_in_seconds [Long]
# @param api_key [String]
# @return [AssemblyAI::AsyncRequestClient]
def initialize(api_key:, environment: Environment::DEFAULT, base_url: nil, max_retries: nil,
def initialize(api_key:, environment: AssemblyAI::Environment::DEFAULT, base_url: nil, max_retries: nil,
timeout_in_seconds: nil)
@default_environment = environment
@base_url = environment || base_url
@headers = {
"X-Fern-Language": "Ruby",
"X-Fern-SDK-Name": "assemblyai",
"X-Fern-SDK-Version": "1.0.0-beta.9",
"X-Fern-SDK-Version": "1.0.0-beta.10",
"Authorization": api_key.to_s
}
@conn = Faraday.new(headers: @headers) do |faraday|
Expand Down

0 comments on commit 03132e1

Please sign in to comment.