Skip to content

Commit e0ab899

Browse files
committed
Update client.js
1 parent 3a5e61a commit e0ab899

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/client.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class RealtimeClient extends RealtimeEventHandler {
191191
* Create a new RealtimeClient instance
192192
* @param {{url?: string, apiKey?: string, model?: string, dangerouslyAllowAPIKeyInBrowser?: boolean, debug?: boolean}} [settings]
193193
*/
194-
constructor({ url, apiKey, model='gpt-4o-realtime-preview-2024-10-01', dangerouslyAllowAPIKeyInBrowser, debug } = {}) {
194+
constructor({ url, apiKey, model, dangerouslyAllowAPIKeyInBrowser, debug } = {}) {
195195
super();
196196
this.defaultSessionConfig = {
197197
modalities: ['text', 'audio'],
@@ -206,7 +206,11 @@ export class RealtimeClient extends RealtimeEventHandler {
206206
temperature: 0.8,
207207
max_response_output_tokens: 4096,
208208
};
209-
this.realtimeModel = model;
209+
if (!model) {
210+
this.realtimeModel = 'gpt-4o-realtime-preview-2024-10-01';
211+
} else {
212+
this.realtimeModel = model;
213+
}
210214
this.sessionConfig = {};
211215
this.transcriptionModels = [
212216
{

0 commit comments

Comments
 (0)