File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11import { RealtimeEventHandler } from './event_handler.js' ;
22import { RealtimeUtils } from './utils.js' ;
33
4+ const defaultModel = 'gpt-4o-mini-realtime-preview-2024-12-17' ;
5+
46export class RealtimeAPI extends RealtimeEventHandler {
57 /**
68 * Create a new RealtimeAPI instance
@@ -56,7 +58,7 @@ export class RealtimeAPI extends RealtimeEventHandler {
5658 * @param {{model?: string} } [settings]
5759 * @returns {Promise<true> }
5860 */
59- async connect ( { model } = { model : 'gpt-4o-realtime-preview-2024-10-01' } ) {
61+ async connect ( { model } = { model : defaultModel } ) {
6062 if ( ! this . apiKey && this . url === this . defaultUrl ) {
6163 console . warn ( `No apiKey provided for connection to "${ this . url } "` ) ;
6264 }
@@ -113,7 +115,7 @@ export class RealtimeAPI extends RealtimeEventHandler {
113115 const wsModule = await import ( /* webpackIgnore: true */ moduleName ) ;
114116 const WebSocket = wsModule . default ;
115117 const ws = new WebSocket (
116- ' wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview-2024-10-01' ,
118+ ` wss://api.openai.com/v1/realtime?model=${ defaultModel } ` ,
117119 [ ] ,
118120 {
119121 finishRequest : ( request ) => {
You can’t perform that action at this time.
0 commit comments