Skip to content

feat(speech_understanding): support effort parameter and force_translation - #264

Open
pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:feat/speech-understanding-effort-force-translation
Open

pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:feat/speech-understanding-effort-force-translation

Conversation

@pylrn

@pylrn pylrn commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the Speech Understanding effort parameter across all feature requests (SpeakerIdentificationRequest, TranslationRequest, and CustomFormattingRequest) as well as force_translation on TranslationRequest, matching AssemblyAI API capabilities and restoring parity with assemblyai-node-sdk.

Previously, if a user configured effort (e.g. "medium" or SpeechUnderstandingEffort.medium) or force_translation, the parameters were silently dropped by Pydantic during model instantiation or assignment to TranscriptionConfig.speech_understanding.

Changes

  • SpeechUnderstandingEffort enum: Added SpeechUnderstandingEffort(str, Enum) with "low" and "medium" values.
  • Request models:
    • SpeakerIdentificationRequest: Added effort: Optional[Union[SpeechUnderstandingEffort, str]] = None.
    • TranslationRequest: Added effort: Optional[Union[SpeechUnderstandingEffort, str]] = None and force_translation: Optional[bool] = False.
    • CustomFormattingRequest: Added effort: Optional[Union[SpeechUnderstandingEffort, str]] = None.
  • Exports: Exported SpeechUnderstandingEffort in assemblyai and assemblyai.types, and added to __all__.
  • Docs: Added speech_understanding to the TranscriptionConfig options list in CLAUDE.md.
  • Tests: Added tests/unit/test_speech_understanding.py covering enum values, request instantiation, serialization with dict(exclude_none=True), TranscriptionConfig assignment, and response parsing.
  • Version bump: Bumped version to 1.6.2.

Testing

  • Full unit test suite: pytest tests/unit passes (734 passed).
  • Ruff check & format: ruff check . and ruff format --check . pass cleanly on all modified files.

…ation

- Add SpeechUnderstandingEffort enum ('low', 'medium') to specify task processing effort
- Expose effort parameter on SpeakerIdentificationRequest, TranslationRequest, and CustomFormattingRequest
- Expose force_translation parameter on TranslationRequest
- Export SpeechUnderstandingEffort from assemblyai and assemblyai.types
- Document speech_understanding in TranscriptionConfig options in CLAUDE.md
- Add comprehensive unit tests in tests/unit/test_speech_understanding.py
- Bump version to 1.6.2
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.

1 participant