Skip to content

feat(dictation): add rewrite_mode to DictationConfig - #270

Merged
aurpsis-aai merged 1 commit into
masterfrom
aurpsis/dictation-rewrite-mode
Oct 16, 2026
Merged

aurpsis-aai merged 1 commit into
masterfrom
aurpsis/dictation-rewrite-mode

Conversation

@aurpsis-aai

@aurpsis-aai aurpsis-aai commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds rewrite_mode to DictationConfig, matching the Dictation API's rewrite_mode config field (live in prod since 2026-10-11). It picks the model tier that runs the transcript rewrite:

  • fast — the server default, lowest latency
  • smart — follows detailed formatting instructions more reliably, at higher latency
config = aai.DictationConfig(
    llm_instruction="Lowercase unless a name, no final punctuation.",
    rewrite_mode=aai.DictationRewriteMode.smart,   # or "smart"
)
  • New DictationRewriteMode(str, Enum) exported from assemblyai, assemblyai.dictation and assemblyai.dictation.v1.
  • rewrite_mode: Optional[DictationRewriteMode] = None. Left unset, it is omitted from the config JSON and the server default applies. Plain strings are accepted, and unknown tiers fail validation client-side, consistent with DictationConfig's extra="forbid" stance.
  • README + CLAUDE.md updated; version 1.6.3 → 1.6.4.

Companion Node SDK PR: assemblyai-node-sdk#196.

Test plan

  • pytest tests/unit: 741 passed (pydantic 2.x)
  • Dictation tests on pydantic 1.10: 120 passed
  • mypy==1.5.1 --follow-imports=silent --ignore-missing-imports on the changed assemblyai/ files (the CI lint job): clean
  • ruff format --check / ruff check on the changed assemblyai/ files: clean
  • Live call against the Dictation API with rewrite_mode="smart"

🤖 Generated with Claude Code

https://claude.ai/code/session_01TNBmFAJar33SLWN2rKnBzJ

Adds `DictationConfig.rewrite_mode` and the `DictationRewriteMode` enum
(`fast` | `smart`), selecting the model tier that runs the Dictation API's
transcript rewrite. Unset, the field is omitted and the server default
(`fast`) applies.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNBmFAJar33SLWN2rKnBzJ
@aurpsis-aai
aurpsis-aai merged commit 7969c14 into master Oct 16, 2026
8 checks passed
@ccampbell-aai
ccampbell-aai deleted the aurpsis/dictation-rewrite-mode branch October 19, 2026 17:55
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