Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[8/n] Make realtime more like the rest of agents sdk #1076

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 12, 2025
Merged

Conversation

rm-openai
Copy link
Collaborator

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

Key changes:

  1. Transport -> model.
  2. Extract any model settings into RealtimeSessionModelSettings.
  3. RealtimeRunConfig, similar to the RunConfig in run.py.
  4. RealtimeRunner now exists, similar to Runner. Returns a RealtimeSession when you call run().
  5. RealtimeSession now uses streaming events instead of listener.

@rm-openai rm-openai changed the base branch from main to rm/pr1073 July 11, 2025 18:19
This was referenced Jul 11, 2025
rm-openai added a commit that referenced this pull request Jul 11, 2025
RealtimeSession is like Runner, except for Realtime. It's also stateful
and manages the conversation for you.







---
[//]: # (BEGIN SAPLING FOOTER)
* #1076
* #1074
* __->__ #1073
* #1072
* #1071
rm-openai added a commit that referenced this pull request Jul 11, 2025
Mostly working demo. Plays audio, shows event log.








---
[//]: # (BEGIN SAPLING FOOTER)
* #1076
* __->__ #1074
Base automatically changed from rm/pr1073 to main July 11, 2025 19:14
@rm-openai rm-openai force-pushed the rm/pr1076 branch 4 times, most recently from e0f956b to 4cb44e9 Compare July 11, 2025 19:47
@rm-openai rm-openai marked this pull request as draft July 11, 2025 19:49
@rm-openai rm-openai marked this pull request as ready for review July 11, 2025 20:11
ui_task = asyncio.create_task(self.ui.run_async())

# Set up session immediately without waiting for UI to finish
runner = RealtimeRunner(agent)
Copy link
Contributor

Choose a reason for hiding this comment

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

the normal runner takes the agent as a parameter to run, why use constructor for realtime?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A common use case is that your Runner is the same, but you want to launch many different long-lived connections with the same config. This lets you do that without needing to re-specify the agent each time.

Copy link
Contributor

@pakrym-oai pakrym-oai Jul 11, 2025

Choose a reason for hiding this comment

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

But that's true even with a normal runner/agent. Do you think this use case is worth the inconsistency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah i think it'll be super common with realtime. regular Runner is static so this wasn't really a consideration there

@seratch seratch added enhancement New feature or request feature:realtime labels Jul 11, 2025
pass

@abc.abstractmethod
async def send_event(self, event: RealtimeClientMessage) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this private?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Specifically wanted to make this public to allow arbitrary events

@rm-openai rm-openai force-pushed the rm/pr1076 branch 3 times, most recently from 0590c72 to bd4e8f9 Compare July 11, 2025 23:43
Key changes:
1. Transport -> model.
2. Extract any model settings into `RealtimeSessionModelSettings`.
3. RealtimeRunConfig, similar to the RunConfig in `run.py`.

Next PR I'll update session to be better.
@rm-openai rm-openai merged commit 3a64c6f into main Jul 12, 2025
4 of 5 checks passed
@rm-openai rm-openai deleted the rm/pr1076 branch July 12, 2025 00:50
rm-openai added a commit that referenced this pull request Jul 12, 2025
---
[//]: # (BEGIN SAPLING FOOTER)
* #1080
* __->__ #1079
* #1076
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:realtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants