Skip to content

Commit 9ea8073

Browse files
committed
updated to cheaper model
1 parent 4e8dd7c commit 9ea8073

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/api.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { RealtimeEventHandler } from './event_handler.js';
22
import { RealtimeUtils } from './utils.js';
33

4+
const defaultModel = 'gpt-4o-mini-realtime-preview-2024-12-17';
5+
46
export 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) => {

0 commit comments

Comments
 (0)