Ruby SDK for the ElevenLabs API, auto-generated from the upstream Python SDK. All resource classes and methods are dynamically created at runtime from lib/elevenlabs/spec.json.
When updating the gem to track the latest elevenlabs-python SDK:
- Pull latest Python SDK:
cd tmp-elevenlabs-python && git pull origin main && cd .. - Regenerate spec:
python3 scripts/extract_spec.py— writeslib/elevenlabs/spec.json - Run tests:
bundle exec rake test— all existing tests must pass - Identify changes: Check for new namespaces, operations, and parameters in the updated spec
- Add tests: Write serialization tests in
test/operation_serialization_test.rband resource tests intest/resources_test.rbfor any new features - Bump version: Edit
lib/elevenlabs/version.rb(minor bump for new namespaces, patch for param changes) - Update README: Version refs, namespace list, examples, changelog entry
- Commit, tag, push: Push to
maintriggers CI (test + publish to GitHub Packages)
See docs/update-procedure.md for the full detailed guide.
# Run tests
bundle exec rake test
# Regenerate spec from Python SDK
python3 scripts/extract_spec.py
# Live API verification (requires ELEVENLABS_API_KEY)
ruby scripts/verify_api.rb
# Build gem locally
gem build elevenlabs-ruby.gemspeclib/elevenlabs/spec.json— 750KB+ spec generated from Python SDK (source of truth for all operations)lib/elevenlabs/resources.rb— Dynamic class generation from spec at runtimelib/elevenlabs/client.rb— Main client with dynamic resource accessorslib/elevenlabs/operation_executor.rb— Executes operations with request serializationlib/elevenlabs/http_client.rb— Faraday-based HTTP client with redirect handlingtmp-elevenlabs-python/— Vendored Python SDK git repo (not published with gem)scripts/extract_spec.py— Spec extraction script
- Tests use Minitest with a
FakeHTTPstub to capture requests without hitting the network - Serialization tests verify: HTTP method, path, query params, JSON/form body, file entries
- Resource tests verify: class generation, method existence, child accessors, caching
- New features must have corresponding tests before version bump