Documentation Index
Fetch the complete documentation index at: https://patter-06b046ce-feat-observability-otel-attrs-0-6-1.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AssemblyAI STT
Streaming speech-to-text via AssemblyAI’s Universal Streaming v3 API. Pure-aiohttp transport, no vendor SDK required.
Install
pip install "getpatter[assemblyai]"
Usage
Use the public STT class either namespaced or flat — both read from ASSEMBLYAI_API_KEY when api_key= is omitted.
# Namespaced import
from getpatter.stt import assemblyai
stt = assemblyai.STT() # reads ASSEMBLYAI_API_KEY
stt = assemblyai.STT(api_key="aa_...")
# Flat alias (equivalent)
from getpatter import AssemblyAISTT
stt = AssemblyAISTT()
Plug it into an agent:
import asyncio
from getpatter import Patter, Twilio, AssemblyAISTT, ElevenLabsTTS
phone = Patter(carrier=Twilio(), phone_number="+15550001234")
agent = phone.agent(
stt=AssemblyAISTT(), # ASSEMBLYAI_API_KEY from env
tts=ElevenLabsTTS(voice_id="rachel"), # ELEVENLABS_API_KEY from env
system_prompt="You are a helpful assistant.",
)
asyncio.run(phone.serve(agent))
Low-level usage
If you are building a custom pipeline outside phone.agent(), the low-level adapter stays importable:
from getpatter.providers.assemblyai_stt import AssemblyAISTT
stt = AssemblyAISTT(api_key="aa_...", model="universal-streaming-english")
await stt.connect()
await stt.send_audio(pcm_chunk) # 16 kHz PCM s16le
async for t in stt.receive_transcripts():
print(t.text, t.is_final, t.confidence)
await stt.close()
For Twilio (mulaw 8 kHz) use AssemblyAISTT.for_twilio(api_key=...).