File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,12 @@ async def _init_websocket_connection(self):
209209 ssl_context .check_hostname = False
210210 ssl_context .verify_mode = ssl .CERT_NONE
211211
212- websocket_url = f"wss://api.openai.com/v1/realtime?model={ self ._config .agent_config .backend .model } "
212+ model_slug = (
213+ "gpt-4o-realtime-preview"
214+ if self ._config .agent_config .backend .model == "gpt-4o-realtime"
215+ else self ._config .agent_config .backend .model
216+ )
217+ websocket_url = f"wss://api.openai.com/v1/realtime?model={ model_slug } "
213218 headers = {
214219 "Authorization" : f"Bearer { self ._provider_config .api_key } " ,
215220 "OpenAI-Beta" : "realtime=v1" ,
@@ -225,6 +230,9 @@ async def _init_websocket_connection(self):
225230 # Handle websocket messages and input streams
226231 self ._loop .create_task (self ._handle_websocket_messages ())
227232
233+ # Create an initial response
234+ await self ._send_websocket_message ({"type" : "response.create" })
235+
228236 def _init_llm_client (self ):
229237 self ._provider_config = get_matched_provider_config (
230238 provider_configs = self ._config .provider_configs ,
You can’t perform that action at this time.
0 commit comments