diff --git a/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/api_proto.py b/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/api_proto.py index 7ad4f6fec..19d665b6c 100644 --- a/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/api_proto.py +++ b/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/api_proto.py @@ -76,6 +76,7 @@ class ServerVad(TypedDict): threshold: NotRequired[float] prefix_padding_ms: NotRequired[int] silence_duration_ms: NotRequired[int] + create_response: bool class FunctionTool(TypedDict): 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 d8db6be28..5f075d609 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 @@ -1461,7 +1461,7 @@ def _handle_response_created( response = response_created["response"] done_fut = self._loop.create_future() status_details = response.get("status_details") - metadata = response.get("metadata") + metadata = (response.get("metadata")).json() new_response = RealtimeResponse( id=response["id"], @@ -1643,8 +1643,8 @@ def _handle_response_done(self, response_done: api_proto.ServerEvent.ResponseDon response.status = response_data["status"] response.status_details = response_data.get("status_details") - response.metadata = response_data.get("metadata") - response.output = response_data.get("output") + response.metadata = (response_data.get("metadata")).json() + response.output = cast(list[RealtimeOutput], response_data.get("output")) response.usage = response_data.get("usage") metrics_error = None