Skip to content

Commit

Permalink
Merge pull request #7 from AssemblyAI/fern-bot/02-09-2024-0731PM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- February 9, 2024
  • Loading branch information
Swimburger committed Feb 9, 2024
2 parents e9e10f9 + 288bca4 commit 4d75080
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 51 deletions.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

5 changes: 2 additions & 3 deletions 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 = "0.0.76"
spec.version = "1.0.0-beta"
spec.authors = AssemblyAI::Gemconfig::AUTHORS
spec.email = AssemblyAI::Gemconfig::EMAIL
spec.summary = AssemblyAI::Gemconfig::SUMMARY
Expand All @@ -14,12 +14,11 @@ Gem::Specification.new do |spec|
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = AssemblyAI::Gemconfig::SOURCE_CODE_URI
spec.metadata["changelog_uri"] = AssemblyAI::Gemconfig::CHANGELOG_URI
spec.files = Dir.glob("lib/**/*") << "LICENSE"
spec.files = Dir.glob("lib/**/*")
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_dependency "async-http-faraday", "~> 0.12"
spec.add_dependency "faraday", "~> 2.7"
spec.add_dependency "faraday-retry", "~> 2.2"
spec.licenses = ["MIT"]
end
4 changes: 2 additions & 2 deletions lib/assemblyai/lemur/types/lemur_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class Lemur
LEMUR_MODEL = {
default: "default",
basic: "basic",
assemblyai_mistral_7_b: "assemblyai/mistral-7b",
anthropic_claude_21: "anthropic/claude-2-1"
assemblyai_mistral7b: "assemblyai/mistral-7b",
anthropic_claude21: "anthropic/claude-2-1"
}.freeze
end
end
2 changes: 1 addition & 1 deletion lib/assemblyai/realtime/types/audio_encoding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
module AssemblyAI
class Realtime
# @type [AUDIO_ENCODING]
AUDIO_ENCODING = { pcm_s_16_le: "pcm_s16le", pcm_mulaw: "pcm_mulaw" }.freeze
AUDIO_ENCODING = { pcm_s16le: "pcm_s16le", pcm_mulaw: "pcm_mulaw" }.freeze
end
end
13 changes: 9 additions & 4 deletions lib/assemblyai/transcripts/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_relative "../../requests"
require_relative "types/transcript_status"
require_relative "types/transcript_list"
require_relative "types/speech_model"
require_relative "types/transcript_language_code"
require_relative "types/transcript_boost_param"
require_relative "types/redact_pii_audio_quality"
Expand Down Expand Up @@ -61,6 +62,7 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil

# Create a transcript from an audio or video file that is accessible via a URL.
#
# @param speech_model [Transcripts::SPEECH_MODEL]
# @param language_code [TRANSCRIPT_LANGUAGE_CODE]
# @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
# @param format_text [Boolean] Enable Text Formatting, can be true or false
Expand Down Expand Up @@ -103,14 +105,15 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil
# @param audio_url [String] The URL of the audio or video file to transcribe.
# @param request_options [RequestOptions]
# @return [Transcripts::Transcript]
def submit(audio_url:, language_code: nil, punctuate: nil, format_text: 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, language_detection: nil, custom_spelling: nil, disfluencies: 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, additional_properties: nil, request_options: nil)
def submit(audio_url:, speech_model: nil, language_code: nil, punctuate: nil, format_text: 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, language_detection: nil, custom_spelling: nil, disfluencies: 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, additional_properties: nil, request_options: nil)
response = @request_client.conn.post("/v2/transcript") 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?
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
req.body = {
**(request_options&.additional_body_parameters || {}),
speech_model: speech_model,
language_code: language_code,
punctuate: punctuate,
format_text: format_text,
Expand Down Expand Up @@ -303,6 +306,7 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil

# Create a transcript from an audio or video file that is accessible via a URL.
#
# @param speech_model [Transcripts::SPEECH_MODEL]
# @param language_code [TRANSCRIPT_LANGUAGE_CODE]
# @param punctuate [Boolean] Enable Automatic Punctuation, can be true or false
# @param format_text [Boolean] Enable Text Formatting, can be true or false
Expand Down Expand Up @@ -345,15 +349,16 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil
# @param audio_url [String] The URL of the audio or video file to transcribe.
# @param request_options [RequestOptions]
# @return [Transcripts::Transcript]
def submit(audio_url:, language_code: nil, punctuate: nil, format_text: 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, language_detection: nil, custom_spelling: nil, disfluencies: 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, additional_properties: nil, request_options: nil)
def submit(audio_url:, speech_model: nil, language_code: nil, punctuate: nil, format_text: 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, language_detection: nil, custom_spelling: nil, disfluencies: 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, additional_properties: nil, request_options: nil)
Async do
response = @request_client.conn.post("/v2/transcript") 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?
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
req.body = {
**(request_options&.additional_body_parameters || {}),
speech_model: speech_model,
language_code: language_code,
punctuate: punctuate,
format_text: format_text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
module AssemblyAI
class Transcripts
# @type [REDACT_PII_AUDIO_QUALITY]
REDACT_PII_AUDIO_QUALITY = { mp_3: "mp3", wav: "wav" }.freeze
REDACT_PII_AUDIO_QUALITY = { mp3: "mp3", wav: "wav" }.freeze
end
end
7 changes: 7 additions & 0 deletions lib/assemblyai/transcripts/types/speech_model.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

module AssemblyAI
class Transcripts
SPEECH_MODEL = String
end
end
Loading

0 comments on commit 4d75080

Please sign in to comment.