{"id":26092930,"url":"https://github.com/assemblyai/assemblyai-ruby-sdk","last_synced_at":"2025-04-12T07:41:23.343Z","repository":{"id":219350440,"uuid":"697933749","full_name":"AssemblyAI/assemblyai-ruby-sdk","owner":"AssemblyAI","description":"The AssemblyAI Ruby SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, audio intelligence models, as well as the latest LeMUR models.","archived":false,"fork":false,"pushed_at":"2024-10-17T23:06:20.000Z","size":1187,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-20T10:14:43.358Z","etag":null,"topics":["ai","asr","assemblyai","llm","ruby","speech-to-text","stt","transcription"],"latest_commit_sha":null,"homepage":"https://www.assemblyai.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AssemblyAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-28T19:21:38.000Z","updated_at":"2024-10-17T23:06:24.000Z","dependencies_parsed_at":"2024-01-26T21:50:40.750Z","dependency_job_id":"be226ebb-e468-43e2-a1e3-cda20a33da9b","html_url":"https://github.com/AssemblyAI/assemblyai-ruby-sdk","commit_stats":null,"previous_names":["assemblyai/assemblyai-ruby-sdk"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fassemblyai-ruby-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fassemblyai-ruby-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fassemblyai-ruby-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AssemblyAI%2Fassemblyai-ruby-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AssemblyAI","download_url":"https://codeload.github.com/AssemblyAI/assemblyai-ruby-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248536990,"owners_count":21120683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","asr","assemblyai","llm","ruby","speech-to-text","stt","transcription"],"created_at":"2025-03-09T11:10:45.852Z","updated_at":"2025-04-12T07:41:23.337Z","avatar_url":"https://github.com/AssemblyAI.png","language":"Ruby","readme":"\u003cimg src=\"https://github.com/AssemblyAI/assemblyai-node-sdk/blob/main/assemblyai.png?raw=true\" width=\"500\"/\u003e\r\n\r\n---\r\n\r\n[![Gem Version](https://img.shields.io/gem/v/assemblyai)](https://rubygems.org/gems/assemblyai)\r\n[![GitHub License](https://img.shields.io/github/license/AssemblyAI/assemblyai-ruby-sdk)](https://github.com/AssemblyAI/assemblyai-ruby-sdk/blob/main/LICENSE)\r\n[![AssemblyAI Twitter](https://img.shields.io/twitter/follow/AssemblyAI?label=%40AssemblyAI\u0026style=social)](https://twitter.com/AssemblyAI)\r\n[![AssemblyAI YouTube](https://img.shields.io/youtube/channel/subscribers/UCtatfZMf-8EkIwASXM4ts0A)](https://www.youtube.com/@AssemblyAI)\r\n[![Discord](https://img.shields.io/discord/875120158014853141?logo=discord\u0026label=Discord\u0026link=https%3A%2F%2Fdiscord.com%2Fchannels%2F875120158014853141\u0026style=social)\r\n](https://assembly.ai/discord)\r\n\r\n# AssemblyAI Ruby SDK\r\n\r\n\u003e [!IMPORTANT]\r\n\u003e As of April 2025, AssemblyAI Ruby SDK **has been discontinued** and will no longer be maintained.\r\n\u003e\r\n\u003e While the SDK will no longer be updated, any previously published releases will remain available.\r\n\u003e\r\n\u003e Going forward, see the [AssemblyAI API reference](https://www.assemblyai.com/docs/api-reference) for information on how to integrate with our API directly. \r\n\u003e\r\n\u003e We know this is a disruptive change. If you need help with this transition, [reach out to our Support team](https://www.assemblyai.com/contact/support) and we'll help you in any way we can.\r\n\r\nThe AssemblyAI Ruby SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async,\r\naudio intelligence models, as well as the latest LeMUR models.\r\n\r\nThe Ruby SDK does not support Streaming STT at this time.\r\n\r\n## Documentation\r\n\r\nVisit the [AssemblyAI documentation](https://www.assemblyai.com/docs) for step-by-step instructions and a lot more details about our AI models and API.\r\n\r\n## Quickstart\r\n\r\nInstall the gem and add to the application's Gemfile by executing:\r\n\r\n```bash\r\nbundle add assemblyai\r\n```\r\n\r\nIf bundler is not being used to manage dependencies, install the gem by executing:\r\n\r\n```bash\r\ngem install assemblyai\r\n```\r\n\r\nImport the AssemblyAI package and create an AssemblyAI object with your API key:\r\n\r\n```ruby\r\nrequire 'assemblyai'\r\n\r\nclient = AssemblyAI::Client.new(api_key: 'YOUR_API_KEY')\r\n```\r\n\r\nYou can now use the `client` object to interact with the AssemblyAI API.\r\n\r\n## Speech-To-Text\r\n\u003cdetails open\u003e\r\n  \u003csummary\u003eTranscribe an audio file with a public URL\u003c/summary\u003e\r\n\r\n```ruby\r\ntranscript = client.transcripts.transcribe(\r\n  audio_url: 'https://assembly.ai/espn.m4a',\r\n)\r\n```\r\n\r\n`transcribe` queues a transcription job and polls it until the `status` is `completed` or `error`.\r\n\r\nIf you don't want to wait until the transcript is ready, you can use `submit`:\r\n\r\n```ruby\r\ntranscript = client.transcripts.submit(\r\n  audio_url: 'https://assembly.ai/espn.m4a'\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\u003cdetails\u003e\r\n  \u003csummary\u003eTranscribe a local audio file\u003c/summary\u003e\r\n\r\n```ruby\r\nuploaded_file = client.files.upload(file: '/path/to/your/file')\r\n# You can also pass an IO object or base64 string\r\n# uploaded_file = client.files.upload(file: File.new('/path/to/your/file'))\r\n\r\ntranscript = client.transcripts.transcribe(audio_url: uploaded_file.upload_url)\r\nputs transcript.text\r\n```\r\n\r\n`transcribe` queues a transcription job and polls it until the `status` is `completed` or `error`.\r\n\r\nIf you don't want to wait until the transcript is ready, you can use `submit`:\r\n\r\n```ruby\r\ntranscript = client.transcripts.submit(audio_url: uploaded_file.upload_url)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n  \u003csummary\u003eEnable additional AI models\u003c/summary\u003e\r\n\r\nYou can extract even more insights from the audio by enabling any of\r\nour [AI models](https://www.assemblyai.com/docs/audio-intelligence) using _transcription options_.\r\nFor example, here's how to\r\nenable [Speaker diarization](https://www.assemblyai.com/docs/speech-to-text/speaker-diarization) model to detect who\r\nsaid what.\r\n\r\n```ruby\r\ntranscript = client.transcripts.transcribe(\r\n  audio_url: audio_url,\r\n  speaker_labels: true\r\n)\r\n\r\ntranscript.utterances.each do |utterance|\r\n  printf('Speaker %\u003cspeaker\u003es: %\u003ctext\u003es', speaker: utterance.speaker, text: utterance.text)\r\nend\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n  \u003csummary\u003eGet a transcript\u003c/summary\u003e\r\n\r\nThis will return the transcript object in its current state. If the transcript is still processing, the `status` field\r\nwill be `queued` or `processing`. Once the transcript is complete, the `status` field will be `completed`.\r\n\r\n```ruby\r\ntranscript = client.transcripts.get(transcript_id: transcript.id)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n  \u003csummary\u003eGet sentences and paragraphs\u003c/summary\u003e\r\n\r\n```ruby\r\nsentences = client.transcripts.get_sentences(transcript_id: transcript.id)\r\np sentences\r\n\r\nparagraphs = client.transcripts.get_paragraphs(transcript_id: transcript.id)\r\np paragraphs\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n  \u003csummary\u003eGet subtitles\u003c/summary\u003e\r\n\r\n```ruby\r\nsrt = client.transcripts.get_subtitles(\r\n  transcript_id: transcript.id,\r\n  subtitle_format: AssemblyAI::Transcripts::SubtitleFormat::SRT\r\n)\r\nsrt = client.transcripts.get_subtitles(\r\n  transcript_id: transcript.id,\r\n  subtitle_format: AssemblyAI::Transcripts::SubtitleFormat::SRT,\r\n  chars_per_caption: 32\r\n)\r\n\r\nvtt = client.transcripts.get_subtitles(\r\n  transcript_id: transcript.id,\r\n  subtitle_format: AssemblyAI::Transcripts::SubtitleFormat::VTT\r\n)\r\nvtt = client.transcripts.get_subtitles(\r\n  transcript_id: transcript.id,\r\n  subtitle_format: AssemblyAI::Transcripts::SubtitleFormat::VTT,\r\n  chars_per_caption: 32\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eList transcripts\u003c/summary\u003e\r\nThis will return a page of transcripts you created.\r\n\r\n```ruby\r\npage = client.transcripts.list\r\n```\r\n\r\nYou can pass parameters to `.list` to filter the transcripts.\r\nTo paginate over all pages, subsequently, use the `.list_by_url` method.\r\n\r\n```ruby\r\nloop do\r\n  page = client.transcripts.list_by_url(url: page.page_details.prev_url)\r\n  break if page.page_details.prev_url.nil?\r\nend\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eDelete a transcript\u003c/summary\u003e\r\n\r\n```ruby\r\nresponse = client.transcripts.delete(transcript_id: transcript.id)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n## Apply LLMs to your audio with LeMUR\r\n\r\nCall [LeMUR endpoints](https://www.assemblyai.com/docs/api-reference/lemur) to apply LLMs to your transcript.\r\n\r\n\u003cdetails open\u003e\r\n\u003csummary\u003ePrompt your audio with LeMUR\u003c/summary\u003e\r\n\r\n```ruby\r\nresponse = client.lemur.task(\r\n  transcript_ids: ['0d295578-8c75-421a-885a-2c487f188927'],\r\n  prompt: 'Write a haiku about this conversation.'\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eSummarize with LeMUR\u003c/summary\u003e\r\n\r\n```ruby\r\nresponse = client.lemur.summary(\r\n  transcript_ids: ['0d295578-8c75-421a-885a-2c487f188927'],\r\n  answer_format: 'one sentence',\r\n  context: {\r\n    'speakers': ['Alex', 'Bob']\r\n  }\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eAsk questions\u003c/summary\u003e\r\n\r\n```ruby\r\nresponse = client.lemur.question_answer(\r\n  transcript_ids: ['0d295578-8c75-421a-885a-2c487f188927'],\r\n  questions: [\r\n    {\r\n      question: 'What are they discussing?',\r\n      answer_format: 'text'\r\n    }\r\n  ]\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\u003cdetails\u003e\r\n\u003csummary\u003eGenerate action items\u003c/summary\u003e\r\n\r\n```ruby\r\nresponse = client.lemur.action_items(\r\n  transcript_ids: ['0d295578-8c75-421a-885a-2c487f188927']\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\u003cdetails\u003e\r\n\u003csummary\u003eDelete LeMUR request\u003c/summary\u003e\r\n\r\n```ruby\r\nresponse = client.lemur.task(...)\r\ndeletion_response = client.lemur.purge_request_data(request_id: response.request_id)\r\n```\r\n\r\n\u003c/details\u003e\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyai%2Fassemblyai-ruby-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemblyai%2Fassemblyai-ruby-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemblyai%2Fassemblyai-ruby-sdk/lists"}