Skip to content

feat: transcriber DX improvements and RealTimeTranscriber rename - #232

Merged
ccampbell-aai merged 2 commits into
masterfrom
ccampbell/dx-additive-fixes
Aug 14, 2026
Merged

feat: transcriber DX improvements and RealTimeTranscriber rename#232
ccampbell-aai merged 2 commits into
masterfrom
ccampbell/dx-additive-fixes

Conversation

@ccampbell-aai

@ccampbell-aai ccampbell-aai commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Stacked on #231 (base is ccampbell/api-key-constructors; retargets to master once that merges). Additive DX improvements across the transcribers plus the streaming rename. No existing behavior changes; all new parameters default to current behavior.

  • README: "Choosing a transcriber" decision table for the four transcriber classes.
  • Config guards: passing a SyncTranscriptionConfig to Transcriber (or the reverse) raises a TypeError naming the right class at the constructor, config setter, and every transcribe call — instead of a bare AttributeError deep in request building. TranscriptionConfig gains a class docstring.
  • Input handling: Transcriber now accepts pathlib.Path and bytearray like its three siblings; unsupported input raises unsupported audio input type: ... instead of a raw httpx error; type aliases match runtime.
  • poll_timeout= (keyword-only, seconds, default None = today's unbounded polling) on Transcriber.transcribe/transcribe_async and AsyncTranscriber.transcribe; on expiry raises TranscriptError naming the transcript id and last status so it can be resumed via get_by_id.
  • Failure-contract docstrings: the polling transcribe methods now document that a failed transcription returns a status=error transcript rather than raising.
  • Sync API errors: _error_from_response falls back to a plain {"error": ...} body instead of degrading to "failed with status NNN".
  • aai.streaming is reachable as an attribute via lazy import (no websockets cost at import assemblyai time).
  • Rename: StreamingClientRealTimeTranscriber, carried through the public streaming surface (AsyncRealTimeTranscriber, RealTimeTranscriberOptions, RealTimeParameters, RealTimeSessionParameters, RealTimeEvents, RealTimeError, RealTimeErrorCodes). Every former Streaming* name remains a plain alias to the same object — isinstance and identity hold in both directions, imports stay warning-free, and the 157 existing streaming tests run unmodified against the old names as compat coverage. README and CLAUDE.md updated to the new names with an alias note.

Bumps the version to 1.0.0 — this PR is the major-release bump. (Written as exactly 1.0.0: PEP 440 normalizes away the trailing-.00 house style, so a v1.0.0 release tag can only match this form.)

Tests: full suite 463 passed (405 pre-existing untouched + 58 in tests/unit/test_dx.py).

Note for reviewers: the SDK historically shipped RealtimeTranscriber (lowercase t) as the old v2 realtime client — the new name differs only in the capital T. Flagging for a deliberate call on whether that collision is acceptable before this lands.

🤖 Generated with Claude Code

@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/dx-additive-fixes branch from a5b98d7 to 8efc520 Compare August 13, 2026 23:58
@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/api-key-constructors branch from ab1a1ec to 8b1920a Compare August 14, 2026 01:39
@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/dx-additive-fixes branch from 8efc520 to 08db516 Compare August 14, 2026 01:39
@ccampbell-aai
ccampbell-aai marked this pull request as ready for review August 14, 2026 01:49
@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/dx-additive-fixes branch 2 times, most recently from 6826c55 to 59ac7f5 Compare August 14, 2026 01:57
@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/api-key-constructors branch from 8b1920a to c280e07 Compare August 14, 2026 01:57
Base automatically changed from ccampbell/api-key-constructors to master August 14, 2026 15:45
@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/dx-additive-fixes branch from 59ac7f5 to 4708588 Compare August 14, 2026 17:40
Adds a "Choosing a transcriber" decision table to the README, and a class
docstring plus failure-contract docs (a failed transcription returns a
Transcript with status error, not an exception) on the job-API methods.

Guards the config type on all four transcribers, so passing a
SyncTranscriptionConfig to Transcriber (or the reverse) raises TypeError
naming both directions instead of failing obscurely downstream.

Unifies audio input handling on the sync Transcriber upload path
(os.PathLike, bytearray, file objects, TypeError for anything else) to
match the async twin, and adds an optional poll_timeout to transcribe,
transcribe_async, and AsyncTranscriber.transcribe.

Parses a bare {"error": ...} body in the sync API, exposes aai.streaming
via a lazy module __getattr__ so importing assemblyai no longer depends on
websockets, and renames the streaming surface to RealTime* with every
former Streaming* name kept as an alias of the same object.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/dx-additive-fixes branch 2 times, most recently from 1faa82e to 3aac013 Compare August 14, 2026 18:25
MIGRATION.md covers what breaks moving from 0.x to 1.0.0 — LeMUR support and
the audio-capture extras were removed — and the recommended pattern for
everything that still works the old way: the RealTime* streaming names, the
canonical top-level import paths, api_key= on constructors, async lifecycle,
poll_timeout=, checking transcript.status, warm() plus keepalive_expiry, and
pathlib.Path inputs. Linked from the README overview and install section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ccampbell-aai
ccampbell-aai force-pushed the ccampbell/dx-additive-fixes branch from 3aac013 to cc8b3c9 Compare August 14, 2026 18:35
@ccampbell-aai
ccampbell-aai merged commit 530eca5 into master Aug 14, 2026
7 checks passed
@ccampbell-aai
ccampbell-aai deleted the ccampbell/dx-additive-fixes branch August 14, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants