Skip to content

Commit 7ab5788

Browse files
authored
fix(langgraph): Unexpected behavior for stream_mode sequences that are not lists (#6354)
## Issue The `stream_mode` argument type includes `Sequence`, but it doesn't correctly support non-list sequences. On the other hand, the `print_mode` argument works as expected. ### Example ```python from langgraph.pregel.main import Pregel pregel = Pregel(nodes={}, channels=None, input_channels=[], output_channels=[], auto_validate=False) stream_modes, *_ = pregel._defaults( config={"recursion_limit": 1}, stream_mode=("values", "messages"), print_mode=("values"), output_keys=None, interrupt_before=None, interrupt_after=None, durability=None, ) print(stream_modes) # Expected `{'values', 'messages'}`, got `{('values', 'messages'), 'values'}` ```
1 parent b0a1029 commit 7ab5788

File tree

1 file changed

+1
-1
lines changed
  • libs/langgraph/langgraph/pregel

1 file changed

+1
-1
lines changed

libs/langgraph/langgraph/pregel/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ def _defaults(
23542354
validate_keys(output_keys, self.channels)
23552355
interrupt_before = interrupt_before or self.interrupt_before_nodes
23562356
interrupt_after = interrupt_after or self.interrupt_after_nodes
2357-
if not isinstance(stream_mode, list):
2357+
if isinstance(stream_mode, str):
23582358
stream_modes = {stream_mode}
23592359
else:
23602360
stream_modes = set(stream_mode)

0 commit comments

Comments
 (0)