Skip to content

feat(speech_understanding): support effort, force_translation, speakers, and format_utterances - #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 complete typed support for Speech Understanding enhancements across all feature requests:

  • effort parameter: Supported across SpeakerIdentificationRequest, TranslationRequest, CustomFormattingRequest, and harmonized with upstream SummarizationRequest and SummarizationResponse.
  • force_translation parameter: Added to TranslationRequest to enable translating audio even when the detected source language matches a target language.
  • format_utterances parameter: Added to CustomFormattingRequest to format utterance-level text.
  • speakers / SpeakerDescription: Added SpeakerDescription model with dictionary compatibility (__getitem__, get, __contains__) and typed speakers on SpeakerIdentificationRequest.
  • SpeechUnderstandingEffort: Enum (low, medium) exported in assemblyai and assemblyai.types and included in __all__.
  • Rebase onto upstream master: Fully rebased on upstream master (including feat(pysdk): Typed support for SU understanding transcript config api #274) with version bumped to 1.6.6 for CI release checks.

Restores full feature and typing parity with assemblyai-node-sdk (PR #197) and assemblyai-mcp (PR #5).

Changes

  • assemblyai/types.py:
    • Define SpeechUnderstandingEffort enum (low, medium).
    • Define SpeakerDescription model supporting both attribute and dict-item subscripting with open extra properties.
    • Expose speakers: Optional[List[Union[SpeakerDescription, Dict[str, Any]]]] = None and effort on SpeakerIdentificationRequest.
    • Expose force_translation: Optional[bool] = False and effort on TranslationRequest.
    • Expose format_utterances: Optional[bool] = False and effort on CustomFormattingRequest.
    • Type effort on SummarizationRequest and SummarizationResponse to accept SpeechUnderstandingEffort enum or literal string.
  • assemblyai/__init__.py: Export SpeechUnderstandingEffort and SpeakerDescription in __all__.
  • assemblyai/__version__.py: Bump to 1.6.6.
  • CLAUDE.md: Document speech_understanding under TranscriptionConfig options.
  • tests/unit/test_speech_understanding.py: 13 comprehensive unit tests covering enum values, request models, dictionary serialization with exclude_none=True, TranscriptionConfig assignment, SpeakerDescription, format_utterances, and response parsing.

Testing

  • Full unit test suite passes: 754 passed in 38s.
  • ruff check and ruff format --check pass cleanly on all modified files.

@pylrn
pylrn force-pushed the feat/speech-understanding-effort-force-translation branch 2 times, most recently from abe7473 to 8ccee7e Compare October 21, 2026 19:01
@pylrn pylrn changed the title feat(speech_understanding): support effort parameter and force_translation feat(speech_understanding): support effort, force_translation, speakers, and format_utterances Oct 21, 2026
…rs, and format_utterances

- Add SpeechUnderstandingEffort enum ('low', 'medium') to specify task processing effort
- Expose effort parameter across SpeakerIdentificationRequest, TranslationRequest, CustomFormattingRequest, and SummarizationRequest
- Expose force_translation parameter on TranslationRequest
- Expose format_utterances parameter on CustomFormattingRequest
- Add SpeakerDescription model and type speakers parameter on SpeakerIdentificationRequest
- Export SpeechUnderstandingEffort and SpeakerDescription from assemblyai and assemblyai.types
- Harmonize with upstream SummarizationRequest/Response effort support
- Document speech_understanding in TranscriptionConfig options in CLAUDE.md
- Add comprehensive unit tests in tests/unit/test_speech_understanding.py
@pylrn
pylrn force-pushed the feat/speech-understanding-effort-force-translation branch from 8ccee7e to 655cf3d Compare October 22, 2026 04:57
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