-
Notifications
You must be signed in to change notification settings - Fork 352
OpenAI Realtime API compatibility? #245
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
Comments
This is a great suggestion! I think changing the input audio messages to match The tricky thing will be mapping the I'm not sure if we can support some events (like |
I think a better approach would be to have some subclass of It should be pretty easy to then create a function to be used in
That's a good point. I don't think it'd be possible to make every handler work as a drop-in OpenAI replacement, but it should be easy to create one if you want to. Ideally we would have some loud error if the client tries to send a message that's not supported, but we would need to somehow know what's supported and what isn't. A good test of whether it works would be using the server as a replacement in the "OpenAI Realtime Console" demo (specifically, the websocket version): https://github.com/openai/openai-realtime-console?tab=readme-ov-file I'll play around with this and try to create some standalone code that would wrap an |
Yes I agree. Perhaps it can be called
I think for now let us sidestep this.
Awesome really looking forward to seeing this! |
I would also be interested in having a custom (possibly subclass) of AdditionalOutputs, to which you can add some custom logic. E.g., an AdditionalJSONOutputs, where I can call json.dumps() directly on the onject and send the data in a stream to the client. |
Uh oh!
There was an error while loading. Please reload this page.
When used as an API server with websockets, FastRTC provides similar functionality to OpenAI's Realtime API.
How about designing the websocket protocol to match OpenAI's, so that FastRTC can be used as a drop-in replacement? This would make adoption very easy for people who are already using the Realtime API.
A similar strategy has worked well for vLLM in the text LLM space: https://github.com/vllm-project/vllm
Perhaps this could work by just taking a
StreamHandler
/AsyncStreamHandler
and running a FastAPI server that would format the messages appropriately. Extra client messages could be passed asAdditionalOutput
, not sure about the extra server messages though.The text was updated successfully, but these errors were encountered: