release: 0.5.0 — instance-based API refactor#68
Merged
Conversation
Ship a clean, instance-based public API for both SDKs. Every provider is a
typed class that reads credentials from environment variables by default, so
a genuine 4-line quickstart composes out of the box:
from patter import Patter, Twilio, OpenAIRealtime
phone = Patter(carrier=Twilio(), phone_number="+15550001234")
agent = phone.agent(engine=OpenAIRealtime(), system_prompt="...")
await phone.serve(agent, tunnel=True)
## What's new
- `patter.carriers.{twilio,telnyx}` with flat `Twilio` / `Telnyx` aliases;
env fallback on `TWILIO_ACCOUNT_SID` / `TELNYX_API_KEY` / etc.
- `patter.engines.{openai,elevenlabs}` with flat `OpenAIRealtime` /
`ElevenLabsConvAI`; env fallback on `OPENAI_API_KEY` /
`ELEVENLABS_API_KEY` + `ELEVENLABS_AGENT_ID`.
- `patter.stt.{deepgram,whisper,cartesia,soniox,speechmatics,assemblyai}`
and `patter.tts.{elevenlabs,openai,cartesia,rime,lmnt}`; each reads
`<VENDOR>_API_KEY` when omitted; flat aliases (`DeepgramSTT`, etc.)
re-exported from the package root.
- `patter.tunnels.{CloudflareTunnel,Static,Ngrok}` instances for tunnel
configuration; `serve(tunnel=True)` kept as a dev alias.
- `Tool` + `@tool` decorator, `Guardrail` + `guardrail(...)` factory.
- Twilio/Telnyx webhook auto-configuration in the TypeScript SDK, now at
parity with the Python SDK (no Twilio Console clicks required).
- Docs rewritten around the new API: `Setting up Patter` nav group with
Carrier / Engines / STT / LLM / TTS subsections; new `engines.mdx` pages
for both SDKs; all code blocks paste-runnable given the right env vars.
## What's removed
- Legacy kwargs on `Patter()` / `new Patter()`: `twilio_sid`, `twilio_token`,
`telnyx_key`, `openai_key`, `deepgram_key`, `elevenlabs_key`, `cartesia_key`,
`rime_key`, `lmnt_key`, `soniox_key`, `speechmatics_key`, `assemblyai_key`.
- Legacy string selectors: `stt="deepgram"`, `tts="elevenlabs"`,
`provider="openai_realtime"`, etc.
- Factory methods `Patter.deepgram()` / `Patter.whisper()` /
`Patter.elevenlabs()` / `Patter.openai_tts()` / `Patter.cartesia()` /
`Patter.rime()` / `Patter.lmnt()` / `Patter.guardrail()` / `Patter.tool()`.
- Dict-form tool and guardrail definitions (typed instances only now).
- ~294 lines of deprecation shim from `sdk-py/patter/client.py`.
- ~251 lines of deprecation shim + `sdk-ts/src/provider-resolver.ts` from
the TypeScript client.
## Validation
- Python: 1327 pytest passing, 8 skipped, 0 failures.
- TypeScript: 1013 vitest passing across 60 files; `tsc --noEmit` clean.
- Both 4-line quickstarts smoke-tested with `-W error::DeprecationWarning`
(Python) and no runtime errors (TypeScript).
## Line-count delta vs main
247 files changed, 4,810 insertions, 9,766 deletions — net **-4,956 lines**.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
For parity with the TypeScript SDK (``npm install getpatter`` +
``import { ... } from "getpatter"``), rename the Python module from
``patter`` to ``getpatter`` so users now do:
pip install getpatter
from getpatter import Patter, Twilio, OpenAIRealtime
Instead of the historical split (``pip install getpatter`` +
``from patter import ...``). Modern Python SDKs (requests, httpx,
fastapi, pydantic, openai, anthropic) align distribution name with
module name — so does Patter starting 0.5.0.
Changes:
- ``sdk-py/patter/`` → ``sdk-py/getpatter/`` (directory move)
- Every ``from patter.X`` / ``import patter.X`` → ``from getpatter.X`` /
``import getpatter.X`` across 190 files (.py, .mdx, .md, .toml).
- ``pyproject.toml``: ``include = ["getpatter*"]``, package-data keys,
``[project.scripts] getpatter = "getpatter.cli:main"``.
- Docs and examples updated.
Full pytest suite (1327 passed, 8 skipped) and 4-line quickstart smoke
test (under ``-W error::DeprecationWarning``) both green on the unified
name.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
**Core Concepts** (`docs/concepts.mdx`) rewritten as a newcomer-friendly
on-ramp: what Patter actually does, the five pluggable building blocks
(Carrier, Engine vs pipeline, Tools, Guardrails, Tunnel), and an ASCII
diagram of the call-flow so a reader who has never seen an STT/LLM/TTS
stack understands where each piece plugs in.
**Nav restructure**:
- Flatten single-page groups (Carrier, Engines, LLM) that rendered as
"Carrier → Carrier" visual duplicates in Mintlify.
- Keep STT and TTS grouped (multiple provider pages each).
- Every top-level page now has an ``icon:`` in frontmatter (phone,
microphone, volume, brain, bolt, wrench, shield, etc.).
- Remove MCP Server from the Dev Tools group and delete
``docs/dev-tools/mcp.mdx``.
- Align page titles across Python/TS (``Guardrails``, ``Events``,
``Advanced Features``).
**Tunneling** (``docs/dev-tools/tunneling.mdx``):
- Document that ``cloudflared`` is not bundled — Python/npm forbid
silent installs at runtime. Added a ``tunnel`` extra in pyproject
so ``pip install "getpatter[tunnel]"`` is the one-liner recipe.
- Quickstart shows both forms (``getpatter[tunnel]`` and the raw
``cloudflared`` package for advanced users).
**Example rewrites**:
- ``docs/examples/basic-{inbound,outbound}.{py,ts}`` were using a
phantom cloud-mode API (``Patter(api_key=...)`` +
``phone.connect()``). Rewritten to the v0.5.0 local-mode shape
(``carrier=Twilio()``, ``engine=OpenAIRealtime()``, tunnel=True).
**Cleanup**:
- Delete orphan ``docs/python-sdk/providers.mdx`` and
``docs/typescript-sdk/providers.mdx`` — superseded by the per-category
STT / TTS / Engines pages.
- Move ``docs/observability.md`` (orphan, stale span names) into
``docs/python-sdk/tracing.mdx`` with consistent ``getpatter.*``
spans and add to the Observability nav group.
- Fix stale "Auto-spawn not yet implemented" note on
``python-sdk/reference.mdx`` ``Ngrok`` entry.
- Quickstart 4-line visual: split the long ``phone.agent(...)`` call
so the primary example fits the width — custom greeting shown in a
follow-up block instead of inline kwargs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # docs/python-sdk/agents.mdx # docs/python-sdk/providers.mdx # docs/python-sdk/reference.mdx # docs/typescript-sdk/providers.mdx # docs/typescript-sdk/reference.mdx
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.
Summary
Patter 0.5.0 ships a clean, instance-based public API for both the Python and TypeScript SDKs. Every provider — carrier, engine, STT, TTS, tunnel — is a typed class that reads its credentials from environment variables by default, so a genuine 4-line quickstart composes out of the box:
TypeScript mirror:
What's new
patter.carriers.{twilio,telnyx}+ flatTwilio/Telnyxpatter.engines.{openai,elevenlabs}+ flatOpenAIRealtime/ElevenLabsConvAIDeepgramSTT,WhisperSTT,CartesiaSTT,SonioxSTT,SpeechmaticsSTT(Python-only),AssemblyAISTTElevenLabsTTS,OpenAITTS,CartesiaTTS,RimeTTS,LMNTTTSCloudflareTunnel(),Static(hostname=...),Ngrok()instances;serve(tunnel=True)kept as dev aliasToolclass +@tooldecorator,Guardrailclass +guardrail(...)factory<VENDOR>_API_KEYwhen the constructor arg is omittedserve()now sets the Twiliovoice_urland associates Telnyx numbers automatically (parity with Python)Setting up Patternav group with Carrier / Engines / STT / LLM / TTS subsections; freshengines.mdxpages for both SDKs; every code block paste-runnableWhat's removed
Patter(twilio_sid=, twilio_token=, openai_key=, deepgram_key=, ...)kwargsstt="deepgram",tts="elevenlabs",provider="openai_realtime")Patter.deepgram(),Patter.whisper(),Patter.elevenlabs(),Patter.openai_tts(),Patter.cartesia(),Patter.rime(),Patter.lmnt(),Patter.guardrail(),Patter.tool()sdk-py/patter/client.pysdk-ts/src/provider-resolver.tsfrom the TypeScript clientLine-count delta
247 files changed, 4,810 insertions, 9,766 deletions → net −4,956 lines.
Test plan
cd sdk-py && python3 -m pytest— 1327 passed, 8 skipped, 0 failurescd sdk-ts && npx tsc --noEmit— clean, exit 0cd sdk-ts && npx vitest run— 1013 tests across 60 files, 0 failures-W error::DeprecationWarningtsxcarrier-config.test.ts(TS) and existing Python adapter testsRelease process (after merge)
v0.5.0onmain→ CI publishes to PyPI (OIDC) and npm automatically🤖 Generated with Claude Code