feat: OpenAI realtime api#935
Conversation
My current understanding is that the mentioned PR cannot be completed to a SDK realtime solution. Here is the context and outcomes of my research why I think so: There are three ways to implement realtime API with OpenAPI:
The previous PR implements SIP - it is a way for client and server to communicate about a connection in order to pass data, but not to establish connection or pass data in fact. The data layer should be implemented separately from the SIP protocol. OpenAPI SIP protocol by design works with client-side web hooks as a mean to pass data and accept incoming connections (calls). Outgoing calls (client initiated) are not seem to be possible at all using solely SIP API. We cannot expect SDK environment to have public http endpoints accessible from the internet to expose hooks. AI Core does not implement hook functionality either AFAIK. Given that WebRTC is difficult to support on the BE and, AFAIK, our backend only supports Websockets at the moment, Websockets seem to be the only option we have. |
Jonas-Isr
left a comment
There was a problem hiding this comment.
The design is very cool! Thanks a lot for the detailed investigation and work :) I am reviewing this as if it would be the beta release already because I think without too much effort we turn this into a releasable state.
The two points below (and many of my comments) concern code conventions in the team.
General points:
- Please add
@Betato all newly introduced public API. This way we have a grace period to change the API if we overlooked something in the beginning. We periodically re-evaluate and remove these annotations later on. - Please don’t put hand written classes into any of the model/ packages. These are only for generated code. If possible, put the
SpeechOutputParaminterface and the 2 classes implementing it into the open package.
addressed both these points in addition to your comments in the PR |
Discussed with @n-o-u-r-h-a-n and @rpanackal. The initial implementation was SIP based and contains only http communication endpoints (and no audio processing implementation nor a means how this processing can be implemented). SIP-based approach requires a public http hook endpoint, which we cannot expect our SDK users to implement. Hence we made the decision to close the previous PR, that was done after discussion. We may reopen and update it later if we decide to support SIP. |
…java into feat/poc-openai-realtime-api
…java into feat/poc-openai-realtime-api
…java into feat/poc-openai-realtime-api
Context
AI/ai-sdk-java-backlog#386.
Adds OpenAI realtime API support
Feature scope:
Definition of Done
Aligned changes with the JavaScript SDK