Skip to content

Realtime: only cancel response if necessary #1243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2025
Merged

Realtime: only cancel response if necessary #1243

merged 1 commit into from
Jul 29, 2025

Conversation

rm-openai
Copy link
Collaborator

@rm-openai rm-openai commented Jul 25, 2025

rm-openai added a commit that referenced this pull request Jul 25, 2025
Will need this for a followup.

---
[//]: # (BEGIN SAPLING FOOTER)
* #1243
* #1242
* __->__ #1235
@rm-openai rm-openai requested a review from seratch July 25, 2025 01:32
@seratch
Copy link
Member

seratch commented Jul 25, 2025

Please check Python 3.9 compatibility

@@ -483,6 +491,9 @@ async def _handle_ws_event(self, event: dict[str, Any]):
await self._emit_event(RealtimeModelTurnEndedEvent())
elif parsed.type == "session.created":
await self._send_tracing_config(self._tracing_config)
self._update_created_session(parsed.session) # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

I looked into the ways to make the type compatible here, but found it's way more complicated than I expect and dealing with it does not bring any benefits to the code... 😅 So, having ignore comments for these is okay for now.

rm-openai added a commit that referenced this pull request Jul 29, 2025
So far, we've been assuming that audio is played:
- immediately (i.e. with 0 delay/latency)
- at realtime

This causes issues with our interrupt tracking. The model wants to know
how much audio the user has actually heard. For example in a phone call
agent, this wouldn't work (bc theres a delay of a few hundred ms between
model sending audio and the user hearing it). This PR allows you to pass
a playback tracker.






---
[//]: # (BEGIN SAPLING FOOTER)
* #1252
* #1216
* #1243
* __->__ #1242
Base automatically changed from rm/pr1242 to main July 29, 2025 18:13
@rm-openai rm-openai merged commit c37c007 into main Jul 29, 2025
10 checks passed
@rm-openai rm-openai deleted the rm/pr1243 branch July 29, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants