Skip to content

Commit

Permalink
Use short URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Sep 26, 2024
1 parent e423987 commit 9332ba6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You can now use the `client` object to interact with the AssemblyAI API.

```ruby
transcript = client.transcripts.transcribe(
audio_url: 'https://storage.googleapis.com/aai-web-samples/espn-bears.m4a',
audio_url: 'https://assembly.ai/espn.m4a',
)
```

Expand All @@ -60,7 +60,7 @@ If you don't want to wait until the transcript is ready, you can use `submit`:

```ruby
transcript = client.transcripts.submit(
audio_url: 'https://storage.googleapis.com/aai-web-samples/espn-bears.m4a'
audio_url: 'https://assembly.ai/espn.m4a'
)
```

Expand Down
4 changes: 2 additions & 2 deletions lib/assemblyai/transcripts/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.transcripts.submit(audio_url: "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3")
# 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)
response = @request_client.conn.post do |req|
Expand Down Expand Up @@ -503,7 +503,7 @@ def list(limit: nil, status: nil, created_on: nil, before_id: nil, after_id: nil
# base_url: "https://api.example.com",
# api_key: "YOUR_API_KEY"
# )
# api.transcripts.submit(audio_url: "https://github.com/AssemblyAI-Examples/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3")
# 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)
Async do
Expand Down
6 changes: 3 additions & 3 deletions test/test_assemblyai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ def test_pagination
end

def test_transcribe
transcript = client.transcripts.transcribe(audio_url: "https://storage.googleapis.com/aai-web-samples/espn-bears.m4a")
transcript = client.transcripts.transcribe(audio_url: "https://assembly.ai/espn.m4a")
assert transcript.status == AssemblyAI::Transcripts::TranscriptStatus::COMPLETED
end

def test_submit
# Transcribe
transcript_submission = client.transcripts.submit(audio_url: "https://storage.googleapis.com/aai-web-samples/espn-bears.m4a")
transcript_submission = client.transcripts.submit(audio_url: "https://assembly.ai/espn.m4a")
assert !transcript_submission.id.nil?
gotten_transcript = client.transcripts.get(transcript_id: transcript_submission.id)
assert gotten_transcript.id == transcript_submission.id
end

def test_polling
transcript = client.transcripts.submit(audio_url: "https://storage.googleapis.com/aai-web-samples/espn-bears.m4a")
transcript = client.transcripts.submit(audio_url: "https://assembly.ai/espn.m4a")
assert !transcript.id.nil?

transcript = client.transcripts.wait_until_ready(transcript_id: transcript.id)
Expand Down

0 comments on commit 9332ba6

Please sign in to comment.