Skip to content

feat(types): add speakers, force_translation, and format_utterances to speech understanding - #197

Open
pylrn wants to merge 2 commits into
AssemblyAI:mainfrom
pylrn:feat/speech-understanding-speakers-force-translation
Open

pylrn wants to merge 2 commits into
AssemblyAI:mainfrom
pylrn:feat/speech-understanding-speakers-force-translation

Conversation

@pylrn

@pylrn pylrn commented Oct 19, 2026

Copy link
Copy Markdown

Summary

Expands the Speech Understanding configuration types in the Node SDK to achieve full parity with AssemblyAI's API and the Python SDK:

  • SpeakerIdentificationRequest.speakers: Accepts an array of SpeakerDescription objects (name, role, description, etc.) for rich speaker identification, providing the typed alternative to known_values when identifying speakers by name or role with context.
  • TranslationRequest.force_translation: Adds the force_translation?: boolean parameter to allow translating transcripts even when the detected source language matches a target language.
  • CustomFormattingRequest.format_utterances: Adds the format_utterances?: boolean parameter to apply custom formatting at the utterance level.
  • Exports SpeakerDescription: Exported from package root via ./types.

Verification

  • npx tsc --noEmit: Clean, 0 type errors.
  • npx rollup -c: Builds all targets (ESM, CJS, UMD, browser, Node, Bun, Deno, workerd) cleanly.
  • Unit tests added in tests/unit/speech-understanding-effort.test.ts verifying speakers (name and role modes), force_translation, and format_utterances: 10/10 tests passing.

This branch has not been deployed

No deployments
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