Skip to content
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

Discrepancy in connect Function: model Parameter Usage Differs Between Browser and Server Implementations #78

Open
muradsofi opened this issue Nov 29, 2024 · 0 comments

Comments

@muradsofi
Copy link

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

  1. Examine the connect function in the RealtimeAPI class.
  2. On the browser side, the model parameter is appended dynamically to the WebSocket URL:
    const ws = new WebSocket(`${this.url}${model ? `?model=${model}` : ''}`, [ /* protocols */ ]);
  3. 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 */ }
    );
  4. The server-side code does not use the model parameter passed to the connect function.

Expected Behavior

The server-side implementation should either:

  1. Use the model parameter dynamically as the browser implementation does, or
  2. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant