Skip to content

Commit 0fc8a4d

Browse files
Increase realtime api websocket frame size to accomodate large model outputs. (#46014)
* Increase max frame size to accomodate model output Occasionally the last message the model sends of it's out output exceeds 65536 bytes causing the output to cut out. To remedy this the limit can be increased. * Update sdk/openai/azure-ai-openai-realtime/src/main/java/com/azure/ai/openai/realtime/implementation/websocket/WebSocketSessionNettyImpl.java Co-authored-by: Jose Alvarez <[email protected]> * Update WebSocketSessionNettyImpl.java Added missing import * Update WebSocketSessionNettyImpl.java Added trailing space --------- Co-authored-by: Jose Alvarez <[email protected]>
1 parent 9c8def4 commit 0fc8a4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdk/openai/azure-ai-openai-realtime/src/main/java/com/azure/ai/openai/realtime/implementation/websocket/WebSocketSessionNettyImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import com.azure.ai.openai.realtime.models.ConnectFailedException;
77
import com.azure.ai.openai.realtime.models.RealtimeClientEvent;
8+
import com.azure.core.util.Configuration;
89
import com.azure.core.util.logging.ClientLogger;
910
import io.netty.bootstrap.Bootstrap;
1011
import io.netty.buffer.PooledByteBufAllocator;
@@ -43,7 +44,7 @@
4344

4445
final class WebSocketSessionNettyImpl implements WebSocketSession {
4546

46-
private static final int MAX_FRAME_SIZE = 65536;
47+
private static final int MAX_FRAME_SIZE = Configuration.getGlobalConfiguration().get("AZURE_MAX_FRAME_SIZE", 65536);
4748

4849
private static final ClientLogger LOGGER = new ClientLogger(WebSocketSessionNettyImpl.class);
4950
private final MessageEncoder messageEncoder;

0 commit comments

Comments
 (0)