From 84e023e10bc91b2abb894c95337114ce50ae3754 Mon Sep 17 00:00:00 2001 From: vbarda Date: Fri, 1 Nov 2024 12:43:59 -0400 Subject: [PATCH] langgraph: handle messages-tuple stream mode in RemoteGraph --- libs/langgraph/langgraph/pregel/remote.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/langgraph/langgraph/pregel/remote.py b/libs/langgraph/langgraph/pregel/remote.py index 35eee1679..d9ee53e8c 100644 --- a/libs/langgraph/langgraph/pregel/remote.py +++ b/libs/langgraph/langgraph/pregel/remote.py @@ -538,6 +538,13 @@ def _get_stream_modes( if "messages" in updated_stream_modes: updated_stream_modes.remove("messages") updated_stream_modes.append("messages-tuple") + + # if requested "messages-tuple", + # map to "messages" in requested_stream_modes + if "messages-tuple" in requested_stream_modes: + requested_stream_modes.remove("messages-tuple") + requested_stream_modes.append("messages") + # add 'updates' mode if not present if "updates" not in updated_stream_modes: updated_stream_modes.append("updates")