diff --git a/app/durableObjects/ChatRoom.server.ts b/app/durableObjects/ChatRoom.server.ts index 9381134..5baca69 100644 --- a/app/durableObjects/ChatRoom.server.ts +++ b/app/durableObjects/ChatRoom.server.ts @@ -25,6 +25,7 @@ import { } from '~/utils/openai.server' const alarmInterval = 15_000 +const defaultOpenAIModelID = 'gpt-4o-realtime-preview-2024-10-01' /** * The ChatRoom Durable Object Class @@ -415,6 +416,8 @@ export class ChatRoom extends Server { params.set('instructions', instructions) } + params.set('model', this.env.OPENAI_MODEL_ID || defaultOpenAIModelID) + // The Calls's offer is sent to OpenAI const openaiAnswer = await requestOpenAIService( openAiTracksResponse.sessionDescription || diff --git a/app/types/Env.ts b/app/types/Env.ts index 84929a1..92210d0 100644 --- a/app/types/Env.ts +++ b/app/types/Env.ts @@ -17,4 +17,5 @@ export type Env = { DB?: D1Database OPENAI_API_TOKEN?: string OPENAI_MODEL_ENDPOINT?: string + OPENAI_MODEL_ID?: string }