Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: Fix incorrect default for Command.update #2809

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libs/langgraph/langgraph/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dataclasses

Check notice on line 1 in libs/langgraph/langgraph/types.py

View workflow job for this annotation

GitHub Actions / benchmark

Benchmark results

......................................... fanout_to_subgraph_10x: Mean +- std dev: 61.3 ms +- 1.0 ms ......................................... fanout_to_subgraph_10x_sync: Mean +- std dev: 52.4 ms +- 0.6 ms ......................................... fanout_to_subgraph_10x_checkpoint: Mean +- std dev: 74.5 ms +- 1.0 ms ......................................... fanout_to_subgraph_10x_checkpoint_sync: Mean +- std dev: 94.9 ms +- 1.6 ms ......................................... fanout_to_subgraph_100x: Mean +- std dev: 616 ms +- 23 ms ......................................... fanout_to_subgraph_100x_sync: Mean +- std dev: 514 ms +- 6 ms ......................................... fanout_to_subgraph_100x_checkpoint: Mean +- std dev: 763 ms +- 14 ms ......................................... fanout_to_subgraph_100x_checkpoint_sync: Mean +- std dev: 945 ms +- 17 ms ......................................... react_agent_10x: Mean +- std dev: 31.0 ms +- 0.8 ms ......................................... react_agent_10x_sync: Mean +- std dev: 22.8 ms +- 0.2 ms ......................................... react_agent_10x_checkpoint: Mean +- std dev: 37.9 ms +- 0.7 ms ......................................... react_agent_10x_checkpoint_sync: Mean +- std dev: 36.9 ms +- 0.5 ms ......................................... react_agent_100x: Mean +- std dev: 342 ms +- 7 ms ......................................... react_agent_100x_sync: Mean +- std dev: 275 ms +- 3 ms ......................................... react_agent_100x_checkpoint: Mean +- std dev: 838 ms +- 7 ms ......................................... react_agent_100x_checkpoint_sync: Mean +- std dev: 829 ms +- 6 ms ......................................... wide_state_25x300: Mean +- std dev: 23.1 ms +- 0.4 ms ......................................... wide_state_25x300_sync: Mean +- std dev: 14.8 ms +- 0.1 ms ......................................... wide_state_25x300_checkpoint: Mean +- std dev: 274 ms +- 13 ms ......................................... wide_state_25x300_checkpoint_sync: Mean +- std dev: 272 ms +- 13 ms ......................................... wide_state_15x600: Mean +- std dev: 27.1 ms +- 0.5 ms ......................................... wide_state_15x600_sync: Mean +- std dev: 17.3 ms +- 0.1 ms ......................................... wide_state_15x600_checkpoint: Mean +- std dev: 471 ms +- 15 ms ......................................... wide_state_15x600_checkpoint_sync: Mean +- std dev: 470 ms +- 14 ms ......................................... wide_state_9x1200: Mean +- std dev: 27.0 ms +- 0.6 ms ......................................... wide_state_9x1200_sync: Mean +- std dev: 17.2 ms +- 0.2 ms ......................................... wide_state_9x1200_checkpoint: Mean +- std dev: 307 ms +- 13 ms ......................................... wide_state_9x1200_checkpoint_sync: Mean +- std dev: 304 ms +- 13 ms

Check notice on line 1 in libs/langgraph/langgraph/types.py

View workflow job for this annotation

GitHub Actions / benchmark

Comparison against main

+----------------------------------------+---------+-----------------------+ | Benchmark | main | changes | +========================================+=========+=======================+ | fanout_to_subgraph_100x | 626 ms | 616 ms: 1.02x faster | +----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_100x_checkpoint | 774 ms | 763 ms: 1.01x faster | +----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint | 842 ms | 838 ms: 1.00x faster | +----------------------------------------+---------+-----------------------+ | react_agent_100x_checkpoint_sync | 831 ms | 829 ms: 1.00x faster | +----------------------------------------+---------+-----------------------+ | wide_state_25x300_sync | 14.8 ms | 14.8 ms: 1.00x slower | +----------------------------------------+---------+-----------------------+ | react_agent_10x_sync | 22.7 ms | 22.8 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | wide_state_15x600_sync | 17.2 ms | 17.3 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_checkpoint_sync | 94.3 ms | 94.9 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x_sync | 52.0 ms | 52.4 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | react_agent_100x | 339 ms | 342 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | fanout_to_subgraph_10x | 60.9 ms | 61.3 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | react_agent_10x_checkpoint | 37.7 ms | 37.9 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | wide_state_15x600 | 26.8 ms | 27.1 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | wide_state_9x1200 | 26.7 ms | 27.0 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | wide_state_25x300 | 22.8 ms | 23.1 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | react_agent_10x | 30.5 ms | 31.0 ms: 1.01x slower | +----------------------------------------+---------+-----------------------+ | Geometric mean | (ref) | 1.00x slower | +----------------------------------------+---------+-----------------------+ Benchmark hidden because not significant (12): wide_state_9x1200_checkpoint, wide_state_9x1200_checkpoint_sync, wide_state_25x300_checkpoint_sync, wide_state_25x300_checkpoint, react_agent_10x_checkpoint_sync, fanout_to_subgraph_100x_sync, wide_state_15x600_checkpoint_sync, wide_state_9x1200_sync, react_agent_100x_sync, wide_state_15x600_checkpoint, fanout_to_subgraph_10x_checkpoint, fanout_to_subgraph_100x_checkpoint_sync
import sys
from collections import deque
from typing import (
Expand Down Expand Up @@ -271,7 +271,7 @@
"""

graph: Optional[str] = None
update: Any = ()
update: Optional[Any] = None
resume: Optional[Union[Any, dict[str, Any]]] = None
goto: Union[Send, Sequence[Union[Send, str]], str] = ()

Expand All @@ -292,8 +292,10 @@
for t in self.update
):
return self.update
else:
elif self.update is not None:
return [("__root__", self.update)]
else:
return []

PARENT: ClassVar[Literal["__parent__"]] = "__parent__"

Expand Down
Loading