Chapter 08 / 14
Provider interfaces
Swappable seams
Speech-to-text accepts audio frames and emits transcript deltas. The model accepts bounded context and emits text deltas or typed tool proposals. Text-to-speech accepts approved text and emits audio. Voice cloning enrols/deletes provider references under consent. Telephony begins, streams, and ends calls through signed webhooks. Address, mail, and storage use the same adapter discipline.
Composition
Application composition selects concrete Python factories; an environment string never imports arbitrary code. Synthetic adapters implement the same protocols and are used in tests and the presentation. Real adapters add vendor authentication, serialization, deadline mapping, and redaction but do not own business policy.
Failure contract
Every provider call has a deadline and cancellation path. Retries are limited to operations known to be safe; idempotency is established before effects. Circuit breakers protect repeated failures. Vendor identifiers may be stored where lifecycle requires them, but raw provider payloads and credentials are not logged.
Current vendor-backed STT/model/TTS, voice cloning, and telephony are implemented but not integrated for production. The public demos are synthetic and labelled accordingly.
| Provider | Protocol | Status |
|---|---|---|
| STTProvider | SpeechToTextProvider | Implemented, not integrated |
| ModelProvider | ModelProvider | Implemented, not integrated |
| TTSProvider | TextToSpeechProvider | Implemented, not integrated |
| VoiceCloneProvider | VoiceCloneProvider | Implemented, not integrated |
| TelephonyProvider | TelephonyProvider | Implemented, not integrated |