-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[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
Conversation
"""A listener for realtime session events.""" | ||
|
||
@abc.abstractmethod | ||
async def on_event(self, event: RealtimeSessionEvent) -> None: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
transport: Literal["websocket"] | RealtimeSessionTransport = "websocket", | ||
api_key: APIKeyOrKeyFunc | None = None, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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
RealtimeSession is like Runner, except for Realtime. It's also stateful and manages the conversation for you.