upgrade to gpt-realtime-1.5
This commit is contained in:
parent
aa5d0f7403
commit
d6b79825ba
5 changed files with 6 additions and 6 deletions
|
|
@ -161,7 +161,7 @@ export async function GET(request: NextRequest) {
|
|||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
model: "gpt-4o-mini-realtime-preview-2024-12-17",
|
||||
model: "gpt-realtime-1.5",
|
||||
instructions: systemPrompt,
|
||||
voice: dbUser.personality?.oai_voice ?? "ballad",
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export async function createRealtimeConnection(
|
|||
await pc.setLocalDescription(offer);
|
||||
|
||||
const baseUrl = "https://api.openai.com/v1/realtime";
|
||||
const model = "gpt-4o-realtime-preview-2024-12-17";
|
||||
const model = "gpt-realtime-1.5";
|
||||
|
||||
const sdpResponse = await fetch(`${baseUrl}?model=${model}`, {
|
||||
method: "POST",
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ export const connectToOpenAI = async ({
|
|||
try {
|
||||
console.log(`Connecting to OpenAI...`);
|
||||
const sessionOptions = {
|
||||
model: "gpt-4o-mini-realtime-preview-2024-12-17",
|
||||
model: "gpt-realtime-1.5",
|
||||
turn_detection: {
|
||||
type: "server_vad",
|
||||
threshold: 0.4,
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export class RealtimeAPI extends RealtimeEventHandler {
|
|||
* @param {{model?: string}} [settings]
|
||||
* @returns {Promise<true>}
|
||||
*/
|
||||
async connect({ model } = { model: 'gpt-4o-realtime-preview-2024-10-01' }) {
|
||||
async connect({ model } = { model: 'gpt-realtime-1.5' }) {
|
||||
if (!this.apiKey && this.url === this.defaultUrl) {
|
||||
console.warn(`No apiKey provided for connection to "${this.url}"`);
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ export class RealtimeAPI extends RealtimeEventHandler {
|
|||
const wsModule = await import(/* webpackIgnore: true */ moduleName);
|
||||
const WebSocket = wsModule.default;
|
||||
const ws = new WebSocket(
|
||||
'wss://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview-2024-10-01',
|
||||
'wss://api.openai.com/v1/realtime?model=gpt-realtime-1.5',
|
||||
[],
|
||||
{
|
||||
finishRequest: (request) => {
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ export class RealtimeClient extends RealtimeEventHandler {
|
|||
* @returns {Promise<true>}
|
||||
*/
|
||||
async connect({
|
||||
model = 'gpt-4o-mini-realtime-preview-2024-12-17',
|
||||
model = 'gpt-realtime-1.5',
|
||||
turn_detection = null,
|
||||
voice,
|
||||
instructions,
|
||||
|
|
|
|||
Loading…
Reference in a new issue