Azure AI VoiceLive client library for Python
This package provides a real-time, speech-to-speech client for Azure AI VoiceLive. It opens a WebSocket session to stream microphone audio to the service and receive typed server events (including audio) for responsive, interruptible conversations.
Status: Preview (
1.3.0b1). This beta release includes the latest SDK and sample updates and may change before the next stable release.
Important: As of version 1.0.0, this SDK is async-only. The synchronous API has been removed to focus exclusively on async patterns. All examples and samples use
async/awaitsyntax.
Getting started
Prerequisites
- Python 3.10+
- An Azure subscription
- A VoiceLive resource and endpoint
- A working microphone and speakers/headphones if you run the voice samples
Install
Install the latest preview version:
# Base install (core client only)
python -m pip install --pre azure-ai-voicelive
# For asynchronous streaming (uses aiohttp)
python -m pip install --pre "azure-ai-voicelive[aiohttp]"
# For voice samples (includes audio processing)
# First install PyAudio dependencies for your platform:
# Linux: sudo apt-get install -y portaudio19-dev libasound2-dev
# macOS: brew install portaudio
python -m pip install --pre "azure-ai-voicelive[aiohttp]" azure-identity pyaudio python-dotenv
The SDK provides async-only WebSocket connections using aiohttp for optimal performance and reliability.
Authenticate
You can authenticate with an API key or a Microsoft Entra ID token.
The samples default to DefaultAzureCredential; for local development, az login is usually the simplest path.
API Key Authentication (Quick Start)
Set environment variables in a .env file or directly in your environment:
# In your .env file or environment variables
AZURE_VOICELIVE_API_KEY="your-api-key"
AZURE_VOICELIVE_ENDPOINT="your-endpoint"
Then, use the key in your code:
import asyncio
from azure.core.credentials import AzureKeyCredential
from azure.ai.voicelive import connect
async def main():
async with connect(
endpoint="your-endpoint",
credential=AzureKeyCredential("your-api-key"),
model="gpt-realtime"
) as connection:
# Your async code here
pass
asyncio.run(main())
AAD Token Authentication
For production applications, Entra ID authentication is recommended:
import asyncio
from azure.identity.aio import DefaultAzureCredential
from azure.ai.voicelive import connect
async def main():
credential = DefaultAzureCredential()
try:
async with connect(
endpoint="your-endpoint",
credential=credential,
model="gpt-realtime"
) as connection:
# Your async code here
pass
finally:
await credential.close()
asyncio.run(main())
Key concepts
- VoiceLiveConnection – Manages an active async WebSocket connection to the service
- Session Management – Configure conversation parameters:
- SessionResource – Update session parameters (voice, formats, VAD) with async methods
- RequestSession – Strongly-typed session configuration
- ServerVad – Configure voice activity detection
- SmartEndOfTurnDetection – Configure audio-based end-of-turn detection
- AzureStandardVoice – Configure voice settings
- parallel_tool_calls – Control whether tool calls may run in parallel for a session
- Audio Handling:
- InputAudioBufferResource – Manage audio input to the service with async methods
- OutputAudioBufferResource – Control audio output from the service with async methods
- Conversation Management:
- ResponseResource – Create or cancel model responses with async methods
- ConversationResource – Manage conversation items with async methods
- ClientEventInputTextDelta / ClientEventInputTextDone – Stream text input incrementally into an item
- Error Handling:
- ConnectionError – Base exception for WebSocket connection errors
- ConnectionClosed – Raised when WebSocket connection is closed
- Strongly-Typed Events – Process service events with type safety:
SESSION_UPDATED,RESPONSE_AUDIO_DELTA,RESPONSE_DONEINPUT_AUDIO_BUFFER_SPEECH_STARTED,INPUT_AUDIO_BUFFER_SPEECH_STOPPEDERROR, and more
Examples
Basic Voice Assistant (Featured Sample)
The Basic Voice Assistant sample demonstrates full-featured voice interaction with:
- Real-time speech streaming
- Server-side voice activity detection
- Interruption handling
- High-quality audio processing
# Run the basic voice assistant sample
# Requires [aiohttp] for async
python samples/basic_voice_assistant_async.py
# With custom parameters
python samples/basic_voice_assistant_async.py --model gpt-realtime --voice alloy --instructions "You're a helpful assistant"
Minimal example
import asyncio
from azure.core.credentials import AzureKeyCredential
from azure.ai.voicelive.aio import connect
from azure.ai.voicelive.models import (
AudioEchoCancellation,
RequestSession,
Modality,
InputAudioFormat,
OutputAudioFormat,
ServerVad,
ServerEventType,
)
API_KEY = "your-api-key"
ENDPOINT = "wss://your-endpoint.com/openai/realtime"
MODEL = "gpt-realtime"
async def main():
async with connect(
endpoint=ENDPOINT,
credential=AzureKeyCredential(API_KEY),
model=MODEL,
) as conn:
session = RequestSession(
modalities=[Modality.TEXT, Modality.AUDIO],
instructions="You are a helpful assistant.",
input_audio_format=InputAudioFormat.PCM16,
output_audio_format=OutputAudioFormat.PCM16,
input_audio_echo_cancellation=AudioEchoCancellation(),
turn_detection=ServerVad(
threshold=0.5,
prefix_padding_ms=300,
silence_duration_ms=500
),
)
await conn.session.update(session=session)
# Process events
async for evt in conn:
print(f"Event: {evt.type}")
if evt.type == ServerEventType.RESPONSE_DONE:
break
asyncio.run(main())
AudioEchoCancellation now supports both the default server loopback reference path and a
client-provided stereo echo reference. Use reference_source="client" with channels=2 only when
your application sends stereo PCM16 input with the microphone on channel 0 and the echo reference
signal on channel 1.
For image inputs, RequestImageContentPart uses the image_url field name.
Available Voice Options
Azure Neural Voices
# Use Azure Neural voices
voice_config = AzureStandardVoice(
name="en-US-AvaNeural", # Or another voice name
type="azure-standard"
)
Popular voices include:
en-US-AvaNeural- Female, natural and professionalen-US-JennyNeural- Female, conversationalen-US-GuyNeural- Male, professional
OpenAI Voices
# Use OpenAI voices (as string)
voice_config = "alloy" # Or another OpenAI voice
Available OpenAI voices:
alloy- Versatile, neutralecho- Precise, clearfable- Animated, expressiveonyx- Deep, authoritativenova- Warm, conversationalshimmer- Optimistic, friendly
Handling Events
async for event in connection:
if event.type == ServerEventType.SESSION_UPDATED:
print(f"Session ready: {event.session.id}")
# Start audio capture
elif event.type == ServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED:
print("User started speaking")
# Stop playback and cancel any current response
elif event.type == ServerEventType.RESPONSE_AUDIO_DELTA:
# Play the audio chunk
audio_bytes = event.delta
elif event.type == ServerEventType.ERROR:
print(f"Error: {event.error.message}")
Troubleshooting
Connection Issues
-
WebSocket connection errors (1006/timeout):
VerifyAZURE_VOICELIVE_ENDPOINT, network rules, and that your credential has access. -
Missing WebSocket dependencies:
If you see import errors, make sure you have installed the package: pip install azure-ai-voicelive[aiohttp] -
Auth failures:
For API key, double-checkAZURE_VOICELIVE_API_KEY. For AAD, ensure the identity is authorized.
Audio Device Issues
-
No microphone/speaker detected:
Check device connections and permissions. On headless CI environments, audio samples can't run. -
Audio library installation problems:
On Linux/macOS you may need PortAudio:# Debian/Ubuntu sudo apt-get install -y portaudio19-dev libasound2-dev # macOS (Homebrew) brew install portaudio
Enable Verbose Logging
import logging
logging.basicConfig(level=logging.DEBUG)
Next steps
-
Run the featured sample:
- Try
samples/basic_voice_assistant_async.pyfor a complete voice assistant implementation
- Try
-
Customize your implementation:
- Experiment with different voices and parameters
- Add custom instructions for specialized assistants
- Integrate with your own audio capture/playback systems
-
Advanced scenarios:
- Add function calling support
- Implement tool usage
- Create multi-turn conversations with history
-
Explore other samples:
- Check the
samples/directory for specialized examples - See
samples/README.mdfor a full list of samples
- Check the
Contributing
This project follows the Azure SDK guidelines. If you'd like to contribute:
- Fork the repo and create a feature branch
- Run linters and tests locally
- Submit a pull request with a clear description of the change
Release notes
Changelogs are available in the package directory.
License
This project is released under the MIT License.
Release History
1.3.0 (2026-08-03)
Features Added
- Azure Realtime Native Voice Support: Added
AzureRealtimeNativeVoiceandAzureRealtimeNativeVoiceName, and expandedvoicefields to accept Azure realtime native voices. - Input Text Streaming Support: Added
ClientEventInputTextDeltaandClientEventInputTextDonefor incrementally streaming text input into existing conversation items. - Hosted Agent Invocation Input: Added
invoke_inputtoResponseCreateParamsandServerEventResponseInvocationDeltafor hosted agent invocation passthrough data. - Echo Cancellation Configuration: Added
EchoCancellationReferenceSourceand newreference_source/channelsoptions onAudioEchoCancellationto support both the default server loopback reference path and client-provided stereo echo reference input. - Parallel Tool Call Control: Added
parallel_tool_callsto session models so callers can control whether tool calls may run in parallel. - Session Expiration: Added
expires_attoResponseSession, a server-setdatetimeindicating when the session expires.
Breaking Changes
- Default API Version Update: Changed the SDK default API version from
2026-06-01-previewto the GA version2026-07-15. Passapi_version="2026-06-01-preview"explicitly to keep the previous default behavior.
Bugs Fixed
- Image Input Field Rename: Renamed
RequestImageContentPart.urltoimage_url. Update image input construction to useimage_url=instead ofurl=.
Other Changes
- Removed Preview Features: The following features introduced in
1.3.0b1are not part of the GA release and have been removed:- WebRTC Call Negotiation Support: Removed
ClientEventRtcCallSdpCreate,ServerEventRtcCallSdpCreated,ServerEventRtcCallError, andRtcCallErrorDetails. - Audio Playback Lifecycle Events: Removed
ServerEventOutputAudioBufferStartedandServerEventOutputAudioBufferStopped. - Smart End-of-Turn Detection: Removed
SmartEndOfTurnDetection.
- WebRTC Call Negotiation Support: Removed
1.3.0b1 (2026-05-28)
Features Added
- Azure Realtime Native Voice Support: Added
AzureRealtimeNativeVoiceandAzureRealtimeNativeVoiceName, and expandedvoicefields to accept Azure realtime native voices. - WebRTC Call Negotiation Support: Added
ClientEventRtcCallSdpCreate,ServerEventRtcCallSdpCreated,ServerEventRtcCallError, andRtcCallErrorDetailsfor SDP-based WebRTC call setup. - Input Text Streaming Support: Added
ClientEventInputTextDeltaandClientEventInputTextDonefor incrementally streaming text input into existing conversation items. - Hosted Agent Invocation Input: Added
invoke_inputtoResponseCreateParamsandServerEventResponseInvocationDeltafor hosted agent invocation passthrough data. - Audio Playback Lifecycle Events: Added
ServerEventOutputAudioBufferStartedandServerEventOutputAudioBufferStoppedto track model audio playback start and stop. - Echo Cancellation Configuration: Added
EchoCancellationReferenceSourceand newreference_source/channelsoptions onAudioEchoCancellationto support both the default server loopback reference path and client-provided stereo echo reference input. - Smart End-of-Turn Detection: Added
SmartEndOfTurnDetectionas an audio-based end-of-turn detection option. - Parallel Tool Call Control: Added
parallel_tool_callsto session models so callers can control whether tool calls may run in parallel.
Breaking Changes
- Image Input Field Rename: Renamed
RequestImageContentPart.urltoimage_url. Update image input construction to useimage_url=instead ofurl=. - Default API Version Update: Changed the SDK default API version from
2026-04-10to2026-06-01-preview. Passapi_version="2026-04-10"explicitly to keep the previous default behavior.
Bug Fixes
- Deserialization Improvements: Improved XML model deserialization and common scalar header deserialization paths for better compatibility and lower overhead.
1.2.0 (2026-05-22)
Features Added
- Web Search & File Search: Added support for built-in web search and file search tools:
- New item types:
ResponseWebSearchCallItem,ResponseFileSearchCallItem - New server events for web/file search lifecycle (
searching,in_progress,completed) - New models:
ActionFind,ActionOpenPage,ActionSearch,ActionSearchSource,FileSearchResult - New enum values:
ItemType.WEB_SEARCH_CALL,ItemType.FILE_SEARCH_CALL - New
SessionIncludeOptionenum for controlling what data is included in session responses
- New item types:
- MCP (Model Context Protocol) Support: Added comprehensive support for Model Context Protocol integration:
MCPServertool type for defining MCP server configurations with authorization, headers, and approval requirementsMCPToolmodel for representing MCP tool definitions with input schemas and annotationsMCPApprovalTypeenum for controlling approval workflows (never,always, or tool-specific)- New item types for MCP approval and call workflows
- New server events for MCP tool listing, call lifecycle, and approval flows
- Avatar Enhancements:
- Added
AzureAvatarVoiceSyncVoicefor avatar voice sync configuration - Added
ServerEventSessionAvatarSwitchToIdleandServerEventSessionAvatarSwitchToSpeakingevents - Added
ServerEventResponseVideoDeltafor avatar video frame streaming - Added
ClientEventOutputAudioBufferClearandServerEventOutputAudioBufferClearedfor output buffer management - Added
AvatarConfigTypesenum with support forvideo-avatarandphoto-avatartypes - Added
AvatarOutputProtocolenum for avatar streaming protocols (webrtc,websocket) - Added
Scenemodel for controlling avatar zoom, position, rotation, and movement amplitude - Added
output_audit_audiofield toAvatarConfig
- Added
- OpenTelemetry Tracing Support: Added
VoiceLiveInstrumentorfor opt-in OpenTelemetry-based tracing of VoiceLive WebSocket connections, following Azure SDK and GenAI semantic conventions.- Enable via
AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACING=trueenvironment variable - Content recording controlled by
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT - Comprehensive session-level telemetry: session ID, audio format, first-token latency, turn count, interruption count, audio bytes sent/received, message size
- Response & function call ID tracking for end-to-end tracing
- Agent v2 telemetry with agent identity and configuration tracking
- MCP telemetry with tool call and approval flow tracking
- Enable via
- Agent Session Configuration: Added flattened
connect()keyword arguments for configuring Azure AI Foundry agents at connection time withagent_name,project_name,agent_version,conversation_id, and more - Transcription Improvements:
- Added
TranscriptionPhraseandTranscriptionWordmodels for detailed transcription data - Added
ServerEventResponseAudioTranscriptAnnotationAddedevent - Added
gpt-4o-transcribe-diarizeandmai-transcribe-1transcription model support
- Added
- Interim Response Configuration: Added
StaticInterimResponseConfigandLlmInterimResponseConfigfor generating interim responses during latency or tool calls - Image Content Support: Added
RequestImageContentPartfor image inputs in conversations - Reasoning Effort Control: Added
reasoning_effortfield withReasoningEffortenum - Response Metadata: Added
metadatafield toResponseandResponseCreateParams - Server Warning Events: Added
ServerEventWarningfor handling non-fatal warnings - Personal Voice Models: Added
DragonHDOmniLatestNeuralandMAI-Voice-1model options - Enhanced OpenAI Voices: Added
marinandcedarvoices toOpenAIVoiceNameenum - Enhanced Azure Personal Voice: Added
custom_lexicon_url,prefer_locales,locale,style,pitch,rate, andvolumeproperties - Pre-generated Assistant Messages: Added
pre_generated_assistant_messageinResponseCreateParams - Explicit Null Values: Enhanced
RequestSessionto properly serialize explicitly setNonevalues
Breaking Changes
- Removed Foundry Agent Tool classes (
FoundryAgentTool,ResponseFoundryAgentCallItem, etc.) — use flattened Azure AI Foundry keyword arguments withconnect()instead - Audio Format Values: Changed
OutputAudioFormatenum values to use underscore format (pcm16_8000hz,pcm16_16000hz) instead of the previous hyphenated values. This is a breaking change for code that compares, persists, or serializes the raw enum values. Legacy hyphenated values continue to deserialize for backward compatibility. - Renamed
AvatarConfig.typefield toavatar_typeto avoid conflict with Python's built-intype
Other Changes
- Updated default API version to
2026-04-10
1.2.0b5 (2026-04-06)
Features Added
- OpenTelemetry Tracing Support: Added
VoiceLiveInstrumentorfor opt-in OpenTelemetry-based tracing of VoiceLive WebSocket connections, following Azure SDK and GenAI semantic conventions (v1.34.0). Instrumentation covers connection lifecycle (connect,close), message send/receive, and captures voice-specific attributes (gen_ai.voice.session_id,gen_ai.voice.event_type).- Enable via
AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACING=trueenvironment variable. - Content recording controlled by
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT. - Aligned with
azure-ai-agents/azure-ai-projectstracing model.
- Enable via
- Enhanced Telemetry Tracking: Added comprehensive session-level and per-message telemetry:
- Session ID: Automatically captured from
session.created/session.updatedevents and set on the parent connect span (gen_ai.voice.session_id). - Audio format/codec: Input and output audio formats extracted from
session.updatesends (gen_ai.voice.input_audio_format,gen_ai.voice.output_audio_format). - First-token latency: Time from
response.createto firstresponse.audio.deltaorresponse.text.delta, recorded asgen_ai.voice.first_token_latency_ms.response.text.deltais used for latency detection only and is not tracked as a normal recv event. - Turn count: Number of completed responses (
response.done) per session (gen_ai.voice.turn_count). - Interruption count: Number of
response.cancelsends per session (gen_ai.voice.interruption_count). - Audio bytes sent/received: Total audio payload bytes transferred
(
gen_ai.voice.audio_bytes_sent,gen_ai.voice.audio_bytes_received). - Message size: WebSocket message size on each send/recv span
(
gen_ai.voice.message_size). - Rate limit / error events: Server
errorandrate_limits.updatedevents recorded as span events with error codes and rate limit details.
- Session ID: Automatically captured from
- Response & Function Call ID Tracking: All recv and send spans now carry correlation IDs for
end-to-end tracing across events:
gen_ai.response.id,gen_ai.conversation.id,gen_ai.voice.call_id,gen_ai.voice.item_id,gen_ai.voice.previous_item_id,gen_ai.voice.output_indexextracted from top-level and nested fields on every event span.gen_ai.response.finish_reasonsfromresponse.doneevents (also propagated to the connect span).
- Agent v2 Telemetry: Added agent identity and configuration tracking on the connect span:
gen_ai.agent.idandgen_ai.agent.thread_idextracted fromsession.created/session.updatedserver events.gen_ai.agent.versionandgen_ai.agent.project_namefrom Azure AI Foundryconnect()keyword arguments at connect time.
- MCP (Model Context Protocol) Telemetry: Added tracking for MCP tool calls and approval flows:
- Per-event:
gen_ai.voice.mcp.server_label,gen_ai.voice.mcp.tool_name,gen_ai.voice.mcp.approval_request_id,gen_ai.voice.mcp.approveon recv/send spans. - Session-level:
gen_ai.voice.mcp.call_countandgen_ai.voice.mcp.list_tools_countcounters flushed on session close. - Nested item extraction is guarded by event type to prevent forward-compatibility issues.
- Per-event:
Other Changes
- Updated default API version to
2026-01-01-preview.
1.2.0b4 (2026-02-12)
Features Added
- Agent Session Configuration: Added flattened
connect()keyword arguments for configuring Azure AI Foundry agents at connection time:agent_name: The name of the agent (required)project_name: The Foundry project containing the agent (required)agent_version: Optional version specificationconversation_id: Optional existing conversation ID to continueauthentication_identity_client_id: Optional client ID for authenticationfoundry_resource_override: Optional Foundry resource override
- Server Warning Events: Added
ServerEventWarningandServerEventWarningDetailsfor handling non-fatal warnings from the service - New Event Type: Added
ServerEventType.WARNINGfor warning event handling
Breaking Changes
- Removed Foundry Agent Tools: The following classes and enums related to Foundry agent tools have been removed:
FoundryAgentTool- Use flattened Azure AI Foundry keyword arguments withconnect()insteadResponseFoundryAgentCallItemFoundryAgentContextTypeenumToolType.FOUNDRY_AGENTenum valueItemType.FOUNDRY_AGENT_CALLenum valueServerEventResponseFoundryAgentCallArgumentsDeltaServerEventResponseFoundryAgentCallArgumentsDoneServerEventResponseFoundryAgentCallInProgressServerEventResponseFoundryAgentCallCompletedServerEventResponseFoundryAgentCallFailed- Related
ServerEventTypeenum values for Foundry agent events
1.2.0b3 (2026-02-02)
Features Added
- Support for Explicit Null Values: Enhanced
RequestSessionto properly serialize explicitly setNonevalues (e.g.,turn_detection=Nonenow correctly sends"turn_detection": nullin the WebSocket message) - Interim Response Configuration: Added support for interim response generation during latency or tool calls:
StaticInterimResponseConfigfor static interim response texts that are randomly selectedLlmInterimResponseConfigfor LLM-generated context-aware interim responsesInterimResponseTriggerenum withlatencyandtooltriggersinterim_responsefield inRequestSessionandResponseSession
- Foundry Agent Integration: Added support for Azure AI Foundry agents:
FoundryAgentToolfor defining Foundry agent configurationsResponseFoundryAgentCallItemfor Foundry agent call responsesFoundryAgentContextTypeenum for context management (no_context,agent_context)- Server events for Foundry agent call lifecycle:
ServerEventResponseFoundryAgentCallArgumentsDelta,ServerEventResponseFoundryAgentCallArgumentsDone,ServerEventResponseFoundryAgentCallInProgress,ServerEventResponseFoundryAgentCallCompleted,ServerEventResponseFoundryAgentCallFailed
- Reasoning Effort Control: Added
reasoning_effortfield toRequestSession,ResponseSession, andResponseCreateParamsfor controlling reasoning models effort levels withReasoningEffortenum (none,minimal,low,medium,high,xhigh) - Response Metadata: Added
metadatafield toResponseandResponseCreateParamsfor attaching up to 16 key-value pairs (max 64 chars for keys, 512 chars for values) - Array Encoding Support: Enhanced serialization to support pipe, space, comma, and newline-delimited array encoding formats
- Custom Text Normalization: Added
custom_text_normalization_urlfield toAzureStandardVoice,AzureCustomVoice, andAzurePersonalVoicefor custom text normalization configurations - Avatar Scene Configuration: Added
Scenemodel for controlling avatar's zoom level, position (x/y), rotation (x/y/z pitch/yaw/roll), and movement amplitude in the video frame - Enhanced Avatar Configuration: Added
sceneandoutput_audit_audiofields toAvatarConfigfor scene control and audit audio forwarding via WebSocket
Other Changes
- Dependency Update: Updated minimum
azure-coreversion from 1.36.0 to 1.37.0 - Security Enhancement: Removed
eval()usage in serialization utilities, replaced with explicit type checking for improved security - Serialization Improvements: Enhanced model_base deserialization for mutable types and array-encoded strings
Bug Fixes
- Audio Format Values: Fixed
OutputAudioFormatenum values to use underscore format (pcm16_8000hz,pcm16_16000hz) instead of hyphenated format for consistency with wire protocol and backward compatibility
1.2.0b2 (2025-11-20)
Features Added
- Enhanced Avatar Configuration: Expanded avatar functionality with new configuration options:
- Added
AvatarConfigTypesenum with support forvideo-avatarandphoto-avatartypes - Added
PhotoAvatarBaseModesenum for photo avatar base models (e.g.,vasa-1) - Added
AvatarOutputProtocolenum for avatar streaming protocols (webrtc,websocket) - Enhanced
AvatarConfigmodel with new properties:type,model, andoutput_protocol
- Added
- Image Content Support: Added support for image inputs in conversations:
- New
RequestImageContentPartmodel for including images in requests - New
RequestImageContentPartDetailenum for controlling image detail levels (auto,low,high) - Added
INPUT_IMAGEtoContentPartTypeenum - Enhanced token details models (
InputTokenDetails,CachedTokenDetails) withimage_tokenstracking
- New
- Enhanced OpenAI Voices: Added new OpenAI voice options:
- Added
marinandcedarvoices toOpenAIVoiceNameenum
- Added
- Extended Azure Personal Voice Configuration: Enhanced
AzurePersonalVoicewith additional customization options:- Added support for custom lexicon via
custom_lexicon_url - Added
prefer_localesfor locale preferences - Added
locale,style,pitch,rate, andvolumeproperties for fine-tuned voice control
- Added support for custom lexicon via
- Enhanced MCP Server Events: Added completion status events for MCP tool calls:
ServerEventResponseMcpCallInProgressfor tracking in-progress MCP callsServerEventResponseMcpCallCompletedfor successful MCP call completionServerEventResponseMcpCallFailedfor failed MCP calls
- Pre-generated Assistant Messages: Added support for pre-generated assistant messages in
ResponseCreateParamsvia thepre_generated_assistant_messageproperty
1.2.0b1 (2025-11-14)
Features Added
- MCP (Model Context Protocol) Support: Added comprehensive support for Model Context Protocol integration:
MCPServertool type for defining MCP server configurations with authorization, headers, and approval requirementsMCPToolmodel for representing MCP tool definitions with input schemas and annotationsMCPApprovalTypeenum for controlling approval workflows (never,always, or tool-specific)- New item types:
MCPApprovalResponseRequestItem,ResponseMCPApprovalRequestItem,ResponseMCPApprovalResponseItem,ResponseMCPCallItem, andResponseMCPListToolItem - New server events:
ServerEventMcpListToolsInProgress,ServerEventMcpListToolsCompleted,ServerEventMcpListToolsFailed,ServerEventResponseMcpCallArgumentsDelta, andServerEventResponseMcpCallArgumentsDone - Client event
MCP_APPROVAL_RESPONSEfor responding to approval requests - Enhanced
ItemTypeenum with MCP-related types:mcp_list_tools,mcp_call,mcp_approval_request, andmcp_approval_response
1.1.0 (2025-11-03)
Features Added
- Added support for Agent configuration through the new
AgentConfigmodel - Added
agentfield toResponseSessionmodel to support agent-based conversations - The
AgentConfigmodel includes properties for agent type, name, description, agent_id, and thread_id
1.1.0b1 (2025-10-06)
Features Added
- AgentConfig Support: Re-introduced
AgentConfigfunctionality with enhanced capabilities:AgentConfigmodel added back to public API with full import and export supportagentfield re-added toResponseSessionmodel for session-level agent configuration- Updated cross-language package mappings to include
AgentConfigsupport - Provides foundation for advanced agent configuration scenarios
1.0.0 (2025-10-01)
Features Added
- Enhanced WebSocket Connection Options: Significantly improved WebSocket connection configuration with transport-agnostic design:
- Added new timeout configuration options:
receive_timeout,close_timeout, andhandshake_timeoutfor fine-grained control - Enhanced
compressionparameter to support both boolean and integer types for advanced zlib window configuration - Added
vendor_optionsparameter for implementation-specific options passthrough (escape hatch for advanced users) - Improved documentation with clearer descriptions for all connection parameters
- Better support for common aliases from other WebSocket ecosystems (
max_size,ping_interval, etc.) - More robust option mapping with proper type conversion and safety checks
- Added new timeout configuration options:
- Enhanced Type Safety: Improved type safety for content parts with proper enum usage:
InputAudioContentPart,InputTextContentPart, andOutputTextContentPartnow useContentPartTypeenum values instead of string literals- Better IntelliSense support and compile-time type checking for content part discriminators
Breaking Changes
- Improved Naming Conventions: Updated model and enum names for better clarity and consistency:
OAIVoiceenum renamed toOpenAIVoiceNamefor more descriptive namingToolChoiceObjectmodel renamed toToolChoiceSelectionfor better semantic meaningToolChoiceFunctionObjectmodel renamed toToolChoiceFunctionSelectionfor consistency- Updated type unions and imports to reflect the new naming conventions
- Cross-language package mappings updated to maintain compatibility across SDKs
- Session Model Architecture: Separated
ResponseSessionandRequestSessionmodels for better design clarity:ResponseSessionno longer inherits fromRequestSessionand now inherits directly from_Model- All session configuration fields are now explicitly defined in
ResponseSessioninstead of being inherited - This provides clearer separation of concerns between request and response session configurations
- May affect type checking and code that relied on the previous inheritance relationship
- Model Cleanup: Removed unused
AgentConfigmodel and related fields from the public API:AgentConfigclass has been completely removed from imports and exportsagentfield removed fromResponseSessionmodel (including constructor parameter)- Updated cross-language package mappings to reflect the removal
- Model Naming Convention Update: Renamed
EOUDetectiontoEouDetectionfor better naming consistency:- Class name changed from
EOUDetectiontoEouDetection - All inheritance relationships updated:
AzureSemanticDetection,AzureSemanticDetectionEn, andAzureSemanticDetectionMultilingualnow inherit fromEouDetection - Type annotations updated in
AzureSemanticVad,AzureSemanticVadEn,AzureSemanticVadMultilingual, andServerVadclasses - Import statements and exports updated to reflect the new naming
- Class name changed from
- Enhanced Content Part Type Safety: Content part discriminators now use enum values instead of string literals:
InputAudioContentPart.typenow usesContentPartType.INPUT_AUDIOinstead of"input_audio"InputTextContentPart.typenow usesContentPartType.INPUT_TEXTinstead of"input_text"OutputTextContentPart.typenow usesContentPartType.TEXTinstead of"text"
Other Changes
- Initial GA release
1.0.0b5 (2025-09-26)
Features Added
- Enhanced Semantic Detection Type Safety: Added new
EouThresholdLevelenum for better type safety in end-of-utterance detection:LOWfor low sensitivity threshold levelMEDIUMfor medium sensitivity threshold levelHIGHfor high sensitivity threshold levelDEFAULTfor default sensitivity threshold level
- Improved Semantic Detection Configuration: Enhanced semantic detection classes with better type annotations:
threshold_levelparameter now supports both string values andEouThresholdLevelenum- Cleaner type definitions for
AzureSemanticDetection,AzureSemanticDetectionEn, andAzureSemanticDetectionMultilingual - Improved documentation for threshold level parameters
- Comprehensive Unit Test Suite: Added extensive unit test coverage with 200+ test cases covering:
- All enum types and their functionality
- Model creation, validation, and serialization
- Async connection functionality with proper mocking
- Client event handling and workflows
- Voice configuration across all supported types
- Message handling with content part hierarchy
- Integration scenarios and real-world usage patterns
- Recent changes validation and backwards compatibility
- API Version Update: Updated to API version
2025-10-01(from2025-05-01-preview) - Enhanced Type Safety: Added new
AzureVoiceTypeenum with values for better Azure voice type categorization:AZURE_CUSTOMfor custom voice configurationsAZURE_STANDARDfor standard voice configurationsAZURE_PERSONALfor personal voice configurations
- Improved Message Handling: Added
MessageRoleenum for better role type safety in message items - Enhanced Model Documentation: Comprehensive documentation improvements across all models:
- Added detailed docstrings for model classes and their parameters
- Enhanced enum value documentation with descriptions
- Improved type annotations and parameter descriptions
- Enhanced Semantic Detection: Added improved configuration options for all semantic detection classes:
- Added
threshold_levelparameter with options:"low","medium","high","default"(recommended over deprecatedthreshold) - Added
timeout_msparameter for timeout configuration in milliseconds (recommended over deprecatedtimeout)
- Added
- Video Background Support: Added new
Backgroundmodel for video background customization:- Support for solid color backgrounds in hex format (e.g.,
#00FF00FF) - Support for image URL backgrounds
- Mutually exclusive color and image URL options
- Support for solid color backgrounds in hex format (e.g.,
- Enhanced Video Parameters: Extended
VideoParamsmodel with:backgroundparameter for configuring video backgrounds using the newBackgroundmodelgop_sizeparameter for Group of Pictures (GOP) size control, affecting compression efficiency and seeking performance
- Improved Type Safety: Added
TurnDetectionTypeenum for better type safety and IntelliSense support - Package Structure Modernization: Simplified package initialization with namespace package support
- Enhanced Error Handling: Added
ConnectionErrorandConnectionClosedexception classes to the async API for better WebSocket error management
Breaking Changes
- Cross-Language Package Identity Update: Updated package ID from
VoiceLivetoVoiceLive.WebSocketfor better cross-language consistency - Model Refactoring:
- Renamed
UserContentParttoMessageContentPartfor clearer content part hierarchy - All message items now require a
contentfield with list ofMessageContentPartobjects OutputTextContentPartnow inherits fromMessageContentPartinstead of being standalone
- Renamed
- Enhanced Type Safety:
- Azure voice classes now use
AzureVoiceTypeenum discriminators instead of string literals - Message role discriminators now use
MessageRoleenum values for better type safety
- Azure voice classes now use
- Removed Deprecated Parameters: Completely removed deprecated parameters from semantic detection classes:
- Removed
thresholdparameter from all semantic detection classes (AzureSemanticDetection,AzureSemanticDetectionEn,AzureSemanticDetectionMultilingual) - Removed
timeoutparameter from all semantic detection classes - Users must now use
threshold_levelandtimeout_msparameters respectively
- Removed
- Removed Synchronous API: Completely removed synchronous WebSocket operations to focus exclusively on async patterns:
- Removed sync
connect()function and syncVoiceLiveConnectionclass from main patch implementation - Removed sync
basic_voice_assistant.pysample (only async version remains) - Simplified sync patch to minimal structure with empty exports
- All functionality now available only through async patterns
- Removed sync
- Updated Dependencies: Modified package dependencies to reflect async-only architecture:
- Moved
aiohttp>=3.9.0,<4.0.0from optional to required dependency - Removed
websocketsoptional dependency as sync API no longer exists - Removed optional dependency groups
websockets,aiohttp, andall-websockets
- Moved
- Model Rename:
- Renamed
AudioInputTranscriptionSettingstoAudioInputTranscriptionOptionsfor consistency with naming conventions - Renamed
AzureMultilingualSemanticVadtoAzureSemanticVadMultilingualfor naming consistency with other multilingual variants
- Renamed
- Enhanced Type Safety: Turn detection discriminator types now use enum values instead of string literals for better type safety
Bug Fixes
- Serialization Improvements: Fixed type casting issue in serialization utilities for better enum handling and type safety
Other Changes
- Testing Infrastructure: Added comprehensive unit test suite with extensive coverage:
- 8 main test files with 200+ individual test methods
- Tests for all enums, models, async operations, client events, voice configurations, and message handling
- Integration tests covering real-world scenarios and recent changes
- Proper mocking for async WebSocket connections
- Backwards compatibility validation
- Test coverage for all recent changes and enhancements
- API Documentation: Updated API view properties to reflect model structure changes, new enums, and cross-language package identity
- Documentation Updates: Comprehensive updates to all markdown documentation:
- Updated README.md to reflect async-only nature with updated examples and installation instructions
- Updated samples README.md to remove sync sample references
- Enhanced BASIC_VOICE_ASSISTANT.md with comprehensive async implementation guide
- Added MIGRATION_GUIDE.md for users upgrading from previous versions
1.0.0b4 (2025-09-19)
Features Added
- Personal Voice Models: Added
PersonalVoiceModelsenum with support forDragonLatestNeural,PhoenixLatestNeural, andPhoenixV2Neuralmodels - Enhanced Animation Support: Added comprehensive server event classes for animation blendshapes and viseme handling:
ServerEventResponseAnimationBlendshapeDeltaandServerEventResponseAnimationBlendshapeDoneServerEventResponseAnimationVisemeDeltaandServerEventResponseAnimationVisemeDone
- Audio Timestamp Events: Added
ServerEventResponseAudioTimestampDeltaandServerEventResponseAudioTimestampDonefor better audio timing control - Improved Error Handling: Added
ErrorResponseclass for better error management - Enhanced Base Classes: Added
ConversationItemBaseandSessionBasefor better code organization and inheritance - Token Usage Improvements: Renamed
UsagetoTokenUsagefor better clarity - Audio Format Improvements: Reorganized audio format enums with separate
InputAudioFormatandOutputAudioFormatenums for better clarity - Enhanced Output Audio Format Support: Added more granular output audio format options including specific sampling rates (8kHz, 16kHz) for PCM16
Breaking Changes
- Model Cleanup: Removed experimental classes
AzurePlatformVoice,LLMVoice,AzureSemanticVadServer,InputAudio,NoTurnDetection, andToolChoiceFunctionObjectFunction - Class Rename: Renamed
Usageclass toTokenUsagefor better clarity - Enum Reorganization:
- Replaced
AudioFormatenum with separateInputAudioFormatandOutputAudioFormatenums - Removed
Phi4mmVoiceenum - Removed
EMOTIONvalue fromAnimationOutputTypeenum - Removed
IN_PROGRESSvalue fromItemParamStatusenum
- Replaced
- Server Events: Removed
RESPONSE_EMOTION_HYPOTHESISfromServerEventTypeenum
Other Changes
- Package Structure: Simplified package initialization with namespace package support
- Sample Updates: Improved basic voice assistant samples
- Code Optimization: Streamlined model definitions with significant code reduction
- API Configuration: Updated API view properties for better tooling support
1.0.0b3 (2025-09-17)
Features Added
- Transcription improvement: Added phrase list
- New Voice Types: Added
AzurePlatformVoiceandLLMVoiceclasses - Enhanced Speech Detection: Added
AzureSemanticVadServerclass - Improved Function Calling: Enhanced async function calling sample with better error handling
- English-Specific Detection: Added
AzureSemanticDetectionEnclass for optimized English-only semantic end-of-utterance detection - English-Specific Voice Activity Detection: Added
AzureSemanticVadEnclass for enhanced English-only voice activity detection
Breaking Changes
- Transcription: Removed
custom_modelandenabledfromAudioInputTranscriptionSettings. - Async Authentication: Fixed credential handling for async scenarios
- Model Serialization: Improved error handling and deserialization
Other Changes
- Code Modernization: Updated type annotations throughout
1.0.0b2 (2025-09-10)
Features Added
- Async function call
Bugs Fixed
- Fixed function calling: ensure
FunctionCallOutputItem.outputis properly serialized as a JSON string before sending to the service.
1.0.0b1 (2025-08-28)
Features Added
- Added WebSocket connection support through
connect(). - Added
VoiceLiveConnectionfor managing WebSocket connections. - Added models of Voice Live preview.
- Added WebSocket-based examples in the samples directory.
Other Changes
- Initial preview release.
Release files for azure-ai-voicelive 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| azure_ai_voicelive-1.3.0.tar.gz | 265.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azure_ai_voicelive-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 425.7 kB
Release files / azure_ai_voicelive-1.3.0.tar.gz
| Download URL | azure_ai_voicelive-1.3.0.tar.gz |
|---|---|
| Size | 265.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93183a534763c35eed50b23b5c5caf170e3fac88a7132698371245b775adcc72
|
|
BLAKE2b-256 checksum How to use checksums |
4c41f5ba6c453c4602afb4ed4d6d835fac13e2c5029b72f546e8ccaa899ed540
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / azure_ai_voicelive-1.3.0-py3-none-any.whl
| Download URL | azure_ai_voicelive-1.3.0-py3-none-any.whl |
|---|---|
| Size | 160.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
afc1ae488dd06b04cb000410129769d89c1f028c412c06536ff6a3f472e2258c
|
|
BLAKE2b-256 checksum How to use checksums |
2ae2bf2c30ebeb09a44613d28d76d12056df9a62e92d72ed08a0653976e7f5a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|