Skip to content

feat(waves): TTS helpers + x-expire-content (DevX, cuts 5.5.0) - #88

Merged
abhishekmishragithub merged 2 commits into
mainfrom
chore/devx-tts-helper
Aug 5, 2026
Merged

feat(waves): TTS helpers + x-expire-content (DevX, cuts 5.5.0)#88
abhishekmishragithub merged 2 commits into
mainfrom
chore/devx-tts-helper

Conversation

@abhishekmishragithub

Copy link
Copy Markdown
Collaborator

DevX pass — TTS start-here ergonomics

client.waves exposes 7 synthesize_* methods with no obvious "start here." Add two convenience wrappers over synthesize_tts for the common case:

from smallestai import SmallestAI
from smallestai.waves.helpers import synthesize_to_file, synthesize_bytes

client = SmallestAI(api_key="...")
synthesize_to_file(client, "Hello.", voice_id="kanik", path="hello.wav")
audio = synthesize_bytes(client, "Hello again.", voice_id="kanik")

Sensible defaults (lightning_v3.1, wav), **kwargs passthrough (sample_rate, speed, language, …). Sync client. Additive — nothing on the generated client changed; new functions in the existing waves/helpers/ package (alongside stream_speech_to_text).

Verification

Live: synthesize_to_file wrote 127KB wav, synthesize_bytes returned 84KB. Mock unit tests assert chunk-join, file write + byte count, and kwargs/defaults forwarding. mypy-clean.

No version bump — part of the DevX pass (with #87). Will cut one 5.5.0 when the pass lands.

🤖 Generated with Claude Code

DevX: the client exposes several synthesize_* TTS methods with no obvious
starting point. Add two convenience wrappers over synthesize_tts for the common
case — write speech to a file, or get the audio bytes — with sensible defaults
(lightning_v3.1, wav) and **kwargs passthrough. Additive; nothing changed on the
generated client. Live-verified + mock unit tests. No version bump (DevX pass).
- Add expire_content=True to the TTS helpers to send the Enterprise
  x-expire-content header, and synthesize_with_expiry() to also read the
  x-content-expiry response outcome (via with_raw_response). Non-Enterprise
  requests still succeed; the opt-in is ignored and the outcome reports it.
- Bump to 5.5.0 with a changelog covering the DevX pass (PlanNotEntitledError +
  actionable error messages, TTS helpers, content-expiry).
@abhishekmishragithub abhishekmishragithub changed the title feat(waves): add synthesize_to_file / synthesize_bytes TTS helpers feat(waves): TTS helpers + x-expire-content (DevX, cuts 5.5.0) Aug 5, 2026
@abhishekmishragithub
abhishekmishragithub merged commit 86842be into main Aug 5, 2026
3 checks passed
@abhishekmishragithub
abhishekmishragithub deleted the chore/devx-tts-helper branch August 5, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant