This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Aleh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're interested in setting up a multilingual agent using LiveKit's RealtimeModel with Azure! Let me guide you through the process step-by-step to make it as smooth as possible: 1. Install Required Plugins: First, you'll want to install the turn detector and OpenAI plugins. You can do this easily with these commands:
Copy code
pip install livekit-plugins-turn-detector
pip install livekit-plugins-openai
1. Download Model Files: Next, run this command to download all the necessary model files:
Copy code
python my_agent.py download-files
1. Configure Azure RealtimeModel: Now, set up your RealtimeModel with your Azure credentials using the
with_azure()
method like this:
Copy code
from livekit.plugins.openai.realtime import RealtimeModel

model = RealtimeModel.with_azure(
    azure_deployment="gpt-realtime",
    azure_endpoint="https://your-endpoint.azure.com",
    api_version="2024-10-01-preview",
    api_key="your-api-key",
)
1. Set Up Multilingual Turn Detection: For detecting turns in multiple languages, use the
MultilingualModel
from the turn detector plugin:
Copy code
from livekit.plugins.turn_detector.multilingual import MultilingualModel

session = AgentSession(
    turn_detection=MultilingualModel(),
)
1. Integrate STT: To support multilingual speech-to-text, you can use a model like Deepgram. Here's how you can integrate it:
Copy code
session = AgentSession(
    stt=deepgram.STT(model="nova-3", language="multi"),
    llm=RealtimeModel.with_azure(...),
    turn_detection=MultilingualModel(),
)
1. Authentication: Lastly, make sure to set your Azure credentials as environment variables in a
.env
file for smooth authentication:
Copy code
AZURE_OPENAI_API_KEY=your-api-key
AZURE_OPENAI_ENDPOINT=https://your-endpoint.azure.com
Following these steps will help you build a multilingual agent with precise turn detection and seamless interactions. If you have any questions or run into any issues, please don’t hesitate to reach out—I’m here to help! Sources: LiveKit turn detector plugin | LiveKit Docs | Azure Speech TTS plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-azure/README.md | Azure OpenAI Realtime API and LiveKit | LiveKit Docs
b
i have only realitime model, no stt
t
I wanted to share a bit of helpful info about the
MultilingualModel
for turn detection. It actually needs an STT (Speech-to-Text) model to work properly because it depends on text transcriptions and language identification from the STT. Without that, the
MultilingualModel
can’t effectively handle multilingual input. Also, if you’re using the RealtimeModel, you’ll still need a separate STT plugin to provide the text input needed for turn detection. If you'd like, I’m here to guide you through integrating an STT model or help you explore other setup options. Just let me know! Sources: LiveKit turn detector plugin | LiveKit Docs | livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/stt.py
b
i dont ask to use MultilingualModel my setup include only
Copy code
llm = RealtimeModel.with_azure(
    azure_deployment=agent_settings.LLM_MODEL,
    voice=agent_settings.LLM_VOICE,
    turn_detection=TurnDetection(
        type="semantic_vad",
        eagerness="auto",
        create_response=True,
        interrupt_response=True,
    ),
)
t
Thanks for reaching out! I wanted to share that Azure's RealtimeModel doesn’t natively support semantic VAD for turn detection, especially when working with multilingual input. To make this work smoothly, here’s a helpful approach you can try: 1. First, disable Azure's built-in VAD by setting
turn_detection=None
in your RealtimeModel configuration. 2. Next, consider using a separate streaming STT service, like Deepgram, to transcribe the audio and provide the text input needed for turn detection. 3. If you want to take it a step further, you can also integrate LiveKit’s
MultilingualModel
for more advanced turn detection capabilities. If you’d like, I’m here to guide you through setting this up or to explore other options together. Just let me know! Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... | agents/src/voice/agent_activity.ts | Gemini Live API plugin | LiveKit docs | Building the all-in-one platform for voice AI agents