Skip to content

Commit 992faf7

Browse files
authored
Realtime: allow arbitrarily sized messages (#1500)
@rzhao-openai was seeing errors about incoming messages being too large. Turns out there's a default limit of 2**20 = 1,048,576 bytes.
1 parent fcb9b50 commit 992faf7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/agents/realtime/openai_realtime.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ async def connect(self, options: RealtimeModelConfig) -> None:
170170
"OpenAI-Beta": "realtime=v1",
171171
}
172172
self._websocket = await websockets.connect(
173-
url, user_agent_header=_USER_AGENT, additional_headers=headers
173+
url,
174+
user_agent_header=_USER_AGENT,
175+
additional_headers=headers,
176+
max_size=None, # Allow any size of message
174177
)
175178
self._websocket_task = asyncio.create_task(self._listen_for_messages())
176179
await self._update_session_config(model_settings)

0 commit comments

Comments
 (0)