Repository navigation
Conversation
client.diarization.diarize({ audio, transcript?, config?, contentType? })
posts multipart audio, an optional transcript with word timings (a sync
transcription response passes straight through) and config to
/v1/diarize. Without a transcript only segments and speakers come back.
Problem+json failures throw DiarizationError. New client option
diarizationBaseUrl (default https://diarization.assemblyai.com; US/EU
data-zone hosts documented). Bump to 4.44.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
client.diarizationfor the standalone Diarization API (POST /v1/diarize), which labels the speakers in an audio file.What's added
client.diarization.diarize({ audio, transcript?, config?, contentType? }, { timeout?, signal? })returns aDiarizationResponse. The layout follows the Dictation (feat(dictation): add client.dictation for the Dictation API #179) and TTS (feat(tts): Text-to-Speech HTTP client and WebSocket session #200) services.SyncTranscriptResponsefromclient.sync.transcribe(..., { timestamps: true }). Onlywordsis sent. Each word comes back with a speaker and the words are grouped into utterances.transcriptto get speaker turns (segments) andspeakers. Diarization can then run in parallel with transcription.diarizationBaseUrlclient option. It defaults tohttps://diarization.assemblyai.com; usehttps://diarization.us.assemblyai.comorhttps://diarization.eu.assemblyai.comto keep requests in that data zone.DiarizationError(status,errorCode,retryAfter) is built by the existing problem+json mapper.Uint8Array/ArrayBuffer,Blob/File, a web stream or a Node stream; URLs are rejected. Content type comes from the extension,audio/pcmwhensample_rate/channelsare set, andcontentTypeoverrides it. PCM without both fields throws before sending. The body is buffered soContent-Lengthis set; the API returns 411 without it.CLAUDE.md, and aCHANGELOGentry. Version 4.43.4 → 4.44.0, a minor bump for a new product, like TTS.Testing
jest tests/unit/diarization.test.ts: 14 passed. They cover:words;.path;Retry-After) mapping;pnpm buildandpnpm lint(eslint, tsc, prettier, publint) are clean.pnpm test:unit: 594 passed, 3 failed. The 3 failures are pre-existing user-agent tests intests/unit/utils.test.ts. They break on Node 22, wherenavigator.userAgentexists; CI runs Node 18 and 20, and this PR doesn't touch that code.Notes for review
diarization.assemblyai.com. TTS defaults totts.us, so say if you'd rather default to the US host.typeisn't used for inference; the extension orcontentTypedecides. No new sample was added.The API itself is live in us-west-2 and eu-west-1. Docs: AssemblyAI/assemblyai-docs#584 (in review; its samples will use this client).
🤖 Generated with Claude Code