feat: regenerate Python SDK (agent/tts namespaces) + bundled realtime connect layer#8
Open
lspeechify wants to merge 10 commits into
Open
feat: regenerate Python SDK (agent/tts namespaces) + bundled realtime connect layer#8lspeechify wants to merge 10 commits into
lspeechify wants to merge 10 commits into
Conversation
Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 4.3.19
Hand-written, .fernignore'd module that opens a realtime voice-agent
session from the {url, token} returned by client.agent.create_conversation
/ create_session. Vendor-neutral surface (connect, connect_conversation,
RealtimeSession); the realtime transport client is an internal import,
never named in the public API. Survives regeneration via .fernignore.
No native device audio in the SDK. Expose the session as raw PCM byte streams the app plumbs itself, plus transcript events: - output_audio() -> async iterator of AudioChunk (agent PCM16) - send_audio(bytes, sample_rate=, num_channels=) -> push caller PCM16 - on_text(cb) -> TextEvent(role, text, final) transcript updates Verified live (create-only): 913 audio chunks / ~876 KB received, input track publishes + captures, 9 transcript events.
examples/realtime_wav.py streams a WAV to a voice agent and saves the reply, using only the SDK's byte-stream surface (output_audio / send_audio / on_text) — no audio-device dependency. examples/README.md shows running it against a hosted Speechify audio sample (speechify.ai/audio/...) converted to PCM16 via ffmpeg. examples/ added to .fernignore so regeneration never clobbers it.
The generated pyproject carried a partial PEP-621 `[project]` table
(name only, no version/dependencies) alongside the real `[tool.poetry]`
config. PEP-621 build frontends (uv, pip git installs) validate
`[project]` and fail ("project.version neither set nor in dynamic"), so
`pip install git+...` / uv source installs were broken (PyPI wheels were
unaffected). Drop the vestigial `[project]`/`[project.urls]` tables and
move the URLs under `[tool.poetry.urls]` so poetry-core fully owns the
metadata. `uv build` now produces sdist + wheel.
NOTE: hand-patch of a generated file; the durable fix is upstream in the
Fern python generator's pyproject emission.
The runnable example lives in the cookbook (speechify-api-cookbook: recipes/voice-agents/python/realtime-conversation), verified end to end before removal. The generated SDK no longer carries an examples/ folder; speechify.realtime usage is documented in the module docstring.
…ltime [DRG-31] Matches the generator's pyproject_python_version=>=3.9 (api PR): SDK floor becomes >=3.9 and livekit is a plain dependency (no marker). 3.8 is EOL and the realtime layer needs 3.9+. Keeps the source-install fix (no [project] table).
Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 4.3.19
Patches applied (1):
- patch-3ae14425: fix(packaging): make the SDK installable from source [DRG-31]
Patches absorbed by generator (1):
- patch-698be8b4: chore(packaging): require python >=3.9 (drop EOL 3.8) for livekit/realtime [DRG-31]
The generator now produces these customizations natively.
SDK regeneration
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.
Regenerates the Python SDK from the updated API spec and adds a hand-written realtime connect layer.
What's in here
1. Regenerated client (product namespaces). Generated from the spec with per-product SDK namespaces, so the surface is:
client.tts.audio.*,client.tts.voices.*client.agent.*(agent CRUD, flattened) +client.agent.{conversations,tools,knowledge_bases,tests,...}(Previously everything was nested under
client.tts.*.) HTTP wire is unchanged — this is the generated SDK method surface only.2.
speechify.realtimeconnect layer (hand-written,.fernignore'd). Opens a realtime voice-agent session from the{ url, token }returned byclient.agent.create_conversation(...)/create_session(...):Public surface is vendor-neutral (
connect,connect_conversation,RealtimeSession, eventsparticipant_joined/audio/disconnected); the realtime transport client is an internal implementation detail. The module lives undersrc/speechify/realtime/and is listed in.fernignore, so regeneration never clobbers it.3. Dependency. Adds the realtime client as a dependency scoped with a Python marker —
python = "^3.8"(base SDK) stays, the realtime client is only pulled on>=3.9(it requires 3.9+). Configured viaextra_dependenciesin the upstreamfern/generators.yml.Notes
poetry installsolve, import smoke, and a live create→connect→disconnect against prod.🤖 Generated with Claude Code