AssemblyAI
Streaming speech-to-text with AssemblyAI Universal-Streaming (v3), plus the sync HTTP service.
Overview
pipedog ports both of Pipecat's AssemblyAI speech-to-text services:
AssemblyAISTTService: Universal-Streaming v3 over a WebSocket, with turn detection, keyterms, diarization, language detection and hot-updatable settings.AssemblyAISyncSTTService: AssemblyAI's sync HTTP API for segmented (VAD-bounded) audio, with optional pre-warming and conversation context.
The same package has AssemblyAI's text-to-speech service.
Installation
bun add @pipedog/assemblyaiPrerequisites
- An AssemblyAI account and API key, passed as
apiKey(the examples readASSEMBLYAI_API_KEY).
AssemblyAISTTService
Configuration
Prop
Type
Settings
Runtime-updatable settings, passed as settings: new AssemblyAISTTService.Settings({...}). Settings you leave out keep their defaults.
| Setting | Type | Default | Description |
|---|---|---|---|
model | string | "universal-3-6-pro" | Speech model. |
language / languageCode / languageCodes | Language / string / Language[] | Language selection. | |
formatTurns | boolean | Return formatted final turns. | |
endOfTurnConfidenceThreshold | number | End-of-turn confidence. | |
minTurnSilence / maxTurnSilence | number | Silence bounds, in ms. | |
keytermsPrompt / prompt | string[] / string | Vocabulary boosting and prompting. | |
speakerLabels | boolean | Speaker diarization. | |
vadThreshold | number | Server VAD threshold. | |
agentContext, previousContextNTurns | Conversation context (updateAgentContext(text) updates it live). |
More (languageDetection, domain, voiceFocus, mode, ...) are listed on AssemblyAISTTSettings.
Usage
import { AssemblyAISTTService } from "@pipedog/assemblyai/stt";
import { STTUpdateSettingsFrame } from "@pipedog/core/frames/frames";
import { Language } from "@pipedog/core/transcriptions/language";
const stt = new AssemblyAISTTService({
apiKey: process.env.ASSEMBLYAI_API_KEY ?? "",
settings: new AssemblyAISTTService.Settings({
model: "universal-3-6-pro",
keytermsPrompt: ["pipedog", "Pipecat"],
languageCodes: [Language.EN, Language.ES],
}),
});Notes
- Emits
InterimTranscriptionFramefor partial turns andTranscriptionFramefor final turns; fireson_end_of_turn. - With
vadForceTurnEndpoint(default), a VAD stop sendsForceEndpoint.
Update settings mid-call; fields AssemblyAI supports are sent as UpdateConfiguration without reconnecting:
// Hot-updatable settings apply without reconnecting.
const update = new STTUpdateSettingsFrame({
delta: new AssemblyAISTTService.Settings({ languageCodes: [Language.ES] }),
});AssemblyAISyncSTTService
Configuration
Prop
Type
Settings
Runtime-updatable settings, passed as settings: new AssemblyAISyncSTTService.Settings({...}). Settings you leave out keep their defaults.
| Setting | Description |
|---|---|
prompt, keytermsPrompt | Prompting and vocabulary boosting. |
conversationContext | Prior turns sent as context. |
languageCodes | Language selection. |
timestamps | Request word timestamps. |
Notes
- Pass
fetchto use your own HTTP client;warm()andenablePrewarmingcall/v1/warm.
Runtimes
| Runtime | Works | What it needs |
|---|---|---|
| Bun | ✅ yes | Nothing. |
| Node.js | ✅ yes | Nothing. |
| Deno | ✅ yes | Nothing. |
| Cloudflare Workers | ✅ yes | Nothing. |
Generated from pipecat.runtimes and pipecat.compat in packages/assemblyai/package.json: ✅ means the compat smoke test passes on that runtime.
The service uses fetch and the global WebSocket (through core's websocketConnect, which sends the auth header on the handshake on Cloudflare Workers too). Pass no SDK; nothing is Node-only. The Sync service uses fetch only.
pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.
Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).