diff --git a/.changeset/cuddly-boxes-look.md b/.changeset/cuddly-boxes-look.md new file mode 100644 index 000000000..50947aa55 --- /dev/null +++ b/.changeset/cuddly-boxes-look.md @@ -0,0 +1,5 @@ +--- +"livekit-plugins-openai": patch +--- + +fix: Azure realtime model does not accept null for max_response_output_tokens diff --git a/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/realtime_model.py b/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/realtime_model.py index aa02e51fc..87d518b1d 100644 --- a/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/realtime_model.py +++ b/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/realtime_model.py @@ -757,6 +757,8 @@ def session_update( session_data["max_response_output_tokens"] = ( self._opts.max_response_output_tokens ) + else: + del session_data["max_response_output_tokens"] # type: ignore self._queue_msg( {