echoing-receptionist-3097
07/29/2025, 9:15 AMtall-airline-16756
07/29/2025, 9:15 AMtall-airline-16756
07/29/2025, 9:17 AMmodalities parameter is not supported in the RealtimeModel.with_azure() method in the Python implementation. This is why you're seeing the TypeError.
To resolve this, you can use the regular RealtimeModel constructor instead, which does support the modalities parameter. Here's an example:
from livekit.plugins import openai
model = openai.realtime.RealtimeModel(
modalities=["text"], # or ["text", "audio"] for both text and audio
azure_deployment="your-deployment",
api_version="2024-10-01-preview",
api_key="your-api-key",
base_url="your-azure-endpoint/openai",
voice="alloy",
temperature=0.8,
# ... other parameters
)
This approach allows you to specify the modalities parameter directly and should work as expected.
Sources: Azure OpenAI Realtime API and LiveKit | LiveKit Docs | plugins/openai/src/realtime/realtime_model.ts | RealtimeModel | LiveKit Agents | examples/voice_agents/realtime_with_tts.py | plugins/openai/src/realtime/realtime_model.tsechoing-receptionist-3097
07/29/2025, 9:36 AMtall-airline-16756
07/29/2025, 9:37 AMazure_endpoint issue. I've got a few friendly solutions that should make things super smooth for you!
Option 1: Use RealtimeModel.with_azure() (Recommended)
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime... | Azure integration guide | LiveKit Docsechoing-receptionist-3097
07/29/2025, 9:38 AMtall-airline-16756
07/29/2025, 9:38 AM