Skip to content

fix(python/voice-live-avatar): replace retired gpt-4o-realtime, align with JS sample#273

Open
zhifzhan wants to merge 2 commits into
microsoft-foundry:mainfrom
zhifzhan:zhifzhan/fix-voice-live-avatar-python
Open

fix(python/voice-live-avatar): replace retired gpt-4o-realtime, align with JS sample#273
zhifzhan wants to merge 2 commits into
microsoft-foundry:mainfrom
zhifzhan:zhifzhan/fix-voice-live-avatar-python

Conversation

@zhifzhan

@zhifzhan zhifzhan commented Jun 12, 2026

Copy link
Copy Markdown

Summary

Fix Python voice-live-avatar demo failing to connect with GPT Realtime (model id was retired) and align its model + voice options with the JavaScript sample.

Symptoms

Clicking Connect with the default GPT Realtime selection produced Error: SESSION_UPDATED event not received. The server log showed Azure rejecting the request with:

Model 'gpt-4o-realtime' has been retired. Please use 'gpt-realtime' instead.

Changes

  • Replace retired model ids gpt-4o-realtime / gpt-4o-mini-realtime with gpt-realtime / gpt-realtime-mini across static/index.html, app.py, voice_handler.py, README.md.
  • Extend the Model dropdown to match the JS sample: add gpt-realtime-1.5, azure-realtime, full gpt-5* cascaded family; drop phi4-mm and phi4-mini.
  • Update the cascaded-model list in static/app.js so cascaded-only UI fields toggle correctly.
  • Add azure-realtime-native voice handling, mirroring the JS sample:
    • New voice type option (visible only when model is azure-realtime).
    • New native voice selector with 11 voices (Aarti, Andrew, Ava, Denise, Elsa, Florian, Francisca, Meera, Xiaoxiao, Ximena, Yunxi).
    • Selecting azure-realtime auto-switches voice type to native and defaults voice to ava; switching away resets to standard.
    • Voice speed field is hidden for native voices.
  • voice_handler._build_voice_config constructs the azure-realtime-native voice via AzureVoice({"type": ..., "name": ...}) since the SDK has no typed subclass for this voice type yet.

Notes

Verified end-to-end against an Azure AI Services endpoint: all 19 models in the new dropdown reach session_started successfully, including azure-realtime with the native voice override.

… models and Azure Realtime UI with JS sample
yulin-li
yulin-li previously approved these changes Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Python voice-live-avatar sample to use the current GPT Realtime model IDs and aligns the frontend model/voice options with the JavaScript sample, including support for azure-realtime native voices.

Changes:

  • Replaced retired gpt-4o-*-realtime defaults with gpt-realtime* in the Python backend and docs.
  • Expanded the model dropdown and updated the cascaded-model list to keep cascaded-only UI fields toggling correctly.
  • Added azure-realtime-native voice support (new UI selector + backend voice config construction).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
python/voice-live-avatar/voice_handler.py Updates default model and adds backend construction for azure-realtime-native voice config.
python/voice-live-avatar/static/index.html Updates model dropdown options and adds UI elements for selecting native voices.
python/voice-live-avatar/static/app.js Adds model-change behavior for azure-realtime, updates cascaded model list, and toggles native-voice UI fields.
python/voice-live-avatar/README.md Updates documented default model value.
python/voice-live-avatar/app.py Updates backend-provided default model returned to the frontend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread python/voice-live-avatar/voice_handler.py
Comment thread python/voice-live-avatar/static/app.js
Comment thread python/voice-live-avatar/static/app.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants