Repository navigation
Commit 0b7ad38
fix(example): refresh realtime push_to_talk_app session types (#2926)
## 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`
---------
Co-authored-by: Rishi Randhawa <rishirandhawa@users.noreply.github.com>
Co-authored-by: Marcus Wood <marcuswood@openai.com>1 parent 90ac74c commit 0b7ad38
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
278 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
279 | 286 | | |
280 | 287 | | |
281 | 288 | | |
| |||
0 commit comments