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

Skip to content

[6/n] RealtimeSession + events #1073

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 3 commits into from
Jul 11, 2025
Merged

[6/n] RealtimeSession + events #1073

merged 3 commits into from
Jul 11, 2025

Conversation

rm-openai
Copy link
Collaborator

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

"""A listener for realtime session events."""

@abc.abstractmethod
async def on_event(self, event: RealtimeSessionEvent) -> None:
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.

why callback and not a streaming interface like in Runner?

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 this is bad, i will change

Comment on lines +90 to +91
transport: Literal["websocket"] | RealtimeSessionTransport = "websocket",
api_key: APIKeyOrKeyFunc | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised the transport is top level and separated from the model.

If we'd like to support 3rd party models they'll have to come with whatever transport they support.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes true, combining them into model

rm-openai added a commit that referenced this pull request Jul 11, 2025
Similar to the TS version.
- Config is the things you can set on the session
- Items are similar to responses items. I'm using an abstraction instead
of reusing the ones in the openai SDK, to reduce the amount of work for
other providers



---
[//]: # (BEGIN SAPLING FOOTER)
* #1074
* #1073
* #1072
* #1071
* __->__ #1070
* #1069
* #1068
rm-openai added a commit that referenced this pull request Jul 11, 2025
Transport interface for actually connecting to the backend and managing
realtime conversations. The transport emits events.






---
[//]: # (BEGIN SAPLING FOOTER)
* #1074
* #1073
* #1072
* __->__ #1071
Base automatically changed from rm/pr1071 to main July 11, 2025 19:12
rm-openai added a commit that referenced this pull request Jul 11, 2025
Uses the openai realtime impl over websockets. Unlike the TS version,
only supports websockets - no in browser stuff.






---
[//]: # (BEGIN SAPLING FOOTER)
* #1074
* #1073
* __->__ #1072
* #1071
@rm-openai rm-openai merged commit 3e0122c into main Jul 11, 2025
9 of 15 checks passed
@rm-openai rm-openai deleted the rm/pr1072 branch July 11, 2025 19:13
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