Python SDK
Experimental: Build jambonz voice applications with jambonz-python-sdk
The jambonz-python-sdk package lets you build jambonz voice applications in Python. It supports webhook and WebSocket transports, a REST API client for mid-call control, and chainable verb methods for building call flows.
Source code: github.com/jambonz/python-sdk
Experimental — This SDK is under active development. APIs may change between releases. Please report issues on GitHub.
Installation
Imports
The SDK provides three submodule imports:
Webhook Transport
Use WebhookResponse to build verb arrays in response to HTTP webhooks. Methods are chainable and the response is serialized to JSON.
WebSocket Transport
Use create_endpoint to build real-time WebSocket applications. This is the recommended transport for voice AI agents, as it enables bidirectional communication, event streaming, and mid-call updates.
.send() vs .reply()
await session.send()— Use once for the initial verb array in response tosession:new.await session.reply()— Use for all subsequent responses to actionHook events.
Application Environment Variables
You can declare environment variables that are configurable in the jambonz portal UI:
Audio Streams
When using the listen verb, make_service.audio() lets you handle both call control and audio on the same server:
REST API Client
Use JambonzClient for outbound calls and mid-call control:
Verb Methods
Both WebhookResponse and WebSocket Session support the same chainable verb methods:
.say() .play() .gather() .dial() .llm() .agent() .conference() .enqueue() .dequeue() .hangup() .pause() .redirect() .config() .tag() .dtmf() .listen() .transcribe() .message() .dub() .alert() .answer() .leave() .sip_decline() .sip_refer() .sip_request()
All methods accept the same options as the corresponding verb JSON schemas and are chainable.
Spec-Driven Verb Generation
The SDK does not hardcode verb method signatures. Verb methods are auto-generated at import time from JSON Schema files — the same schemas used by the Node.js SDK and the jambonz server. When the schema adds a new property to a verb, the SDK picks it up automatically with no code change needed.
TTS Token Streaming
The WebSocket Session provides methods for incremental TTS token streaming, enabling low-latency voice AI experiences:
LLM and Agent Updates
Tool Output
When the LLM requests a tool/function call, respond with the result:
Agent Updates
Send mid-conversation updates to an active agent:
LLM Updates
Inject Commands
Inject commands execute immediately on an active call without affecting the verb stack:
Session Properties
Examples
See the examples directory for runnable demos: