Merge pull request #2296 from langchain-ai/vb/remap

langgraph: handle messages-tuple stream mode in RemoteGraph
This commit is contained in:
Nuno Campos
2024-11-01 09:50:51 -07:00
committed by GitHub
@@ -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")