Skip to content

remove hardcoded model parameter and make it configurable #108

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ValorLin
Copy link

fix: remove hardcoded model parameter and make it configurable

  • Replace hardcoded model strings with the defaultModel value
  • Modify RealtimeClient connect method to pass model parameter to RealtimeAPI
  • Add defaultModel property to RealtimeAPI class
  • Add test case for connecting with a specific model

Fix #89

@mhjacobson
Copy link

Thanks for the patch! It fixed the bug for me, and I recommend they take it.

@djfm
Copy link

djfm commented May 8, 2025

Lol I had not seen this PR, I've opened my own to solve the same issue.

We have slightly different approaches, I've opted to make the choice of the model a required parameter of the client's connect method because using the wrong model can cost you like 15x more than you intended.

So my thinking was that the model arg needs to either be explicit or the default should be the cheapest one (blah-blah-mini).

I realize I should probably make it mandatory in the API's connect method too if I want to be consistent.

OpenAI doesn't care about PRs I assume, seeing the date of yours?

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

Successfully merging this pull request may close these issues.

Model gpt-4o-realtime-preview-2024-10-01 should not be hardcoded
4 participants