Skip to content

fix(example): refresh realtime push_to_talk_app session types#2926

Open
Rishirandhawa wants to merge 1 commit intoopenai:mainfrom
Rishirandhawa:fix/realtime-push-to-talk-session-import
Open

fix(example): refresh realtime push_to_talk_app session types#2926
Rishirandhawa wants to merge 1 commit intoopenai:mainfrom
Rishirandhawa:fix/realtime-push-to-talk-session-import

Conversation

@Rishirandhawa
Copy link

@Rishirandhawa Rishirandhawa commented Mar 3, 2026

Summary

  • fix Session import in examples/realtime/push_to_talk_app.py to use openai.types.realtime.session_update_event
  • guard access to turn_detection for session variants that may not expose that attribute
  • annotate session.id access with type: ignore and comment, since the field is present at runtime but missing in generated typing

Why

openai.types.realtime.session no longer exists, so the example currently fails on import with recent SDK versions.

Fixes #2715

Validation

  • python3 -m py_compile examples/realtime/push_to_talk_app.py
  • python3 -m ruff check examples/realtime/push_to_talk_app.py

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.

examples/realtime/push_to_talk_app.py is grossly outdated

1 participant