langgraph: handle messages-tuple stream mode in RemoteGraph

This commit is contained in:
vbarda
2024-11-01 12:43:59 -04:00
parent d9743f684e
commit 84e023e10b
@@ -538,6 +538,13 @@ class RemoteGraph(PregelProtocol):
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")