Discrepancy in connect Function: model Parameter Usage Differs Between Browser and Server Implementations
Opened this issue · 0 comments
In the RealtimeAPI class, the connect function accepts a model parameter on the browser side and includes it dynamically in the WebSocket URL. However, on the server side (Node.js), the model seems to be hardcoded as gpt-4o-realtime-preview-2024-10-01 and does not utilize the model argument passed to the function.
It's unclear if this behavior is intentional or an oversight. Could you clarify whether the server-side implementation is designed to always use a static model or if it should also respect the model parameter provided during connection?
Steps to Reproduce
- Examine the
connectfunction in theRealtimeAPIclass. - On the browser side, the
modelparameter is appended dynamically to the WebSocket URL:const ws = new WebSocket(`${this.url}${model ? `?model=${model}` : ''}`, [ /* protocols */ ]);
- On the server side, the WebSocket URL has the model hardcoded as:
const ws = new WebSocket( 'wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview-2024-10-01', [], { /* options */ } );
- The server-side code does not use the
modelparameter passed to theconnectfunction.
Expected Behavior
The server-side implementation should either:
- Use the
modelparameter dynamically as the browser implementation does, or - Provide a comment or documentation clarifying that the model is intentionally static on the server side.
Actual Behavior
The server-side implementation always uses the hardcoded model gpt-4o-realtime-preview-2024-10-01, ignoring the model parameter.
Additional Context
Please confirm if this discrepancy is intentional. If it’s by design, could you clarify the reasoning? If not, should the server-side implementation be updated to dynamically use the model parameter as the browser implementation does?