From d15eb4d6a563ec701b3e8f76d46591bb2a5618b0 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Tue, 15 Oct 2024 23:05:34 -0700 Subject: [PATCH] fix: Azure realtime model does not accept null for max_response_output_tokens (#927) --- .changeset/cuddly-boxes-look.md | 5 +++++ .../livekit/plugins/openai/realtime/realtime_model.py | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/cuddly-boxes-look.md 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( {