8000 Discrepancy in connect Function: model Parameter Usage Differs Between Browser and Server Implementations · Issue #78 · openai/openai-realtime-api-beta · GitHub
[go: up one dir, main page]

Skip to content
Discrepancy in connect Function: model Parameter Usage Differs Between Browser and Server Implementations #78
Open
@muradsofi

Description

@muradsofi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0