From c3f68a6d7eb7dc46a27f280d2ce5bc96388aeee9 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 29 May 2024 16:47:39 -0700 Subject: [PATCH] Use the last annotation as the reducer --- langgraph/graph/state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langgraph/graph/state.py b/langgraph/graph/state.py index 450618958..9e7c00ced 100644 --- a/langgraph/graph/state.py +++ b/langgraph/graph/state.py @@ -466,7 +466,7 @@ def _get_channel( def _is_field_binop(typ: Type[Any]) -> Optional[BinaryOperatorAggregate]: if hasattr(typ, "__metadata__"): meta = typ.__metadata__ - if len(meta) == 1 and callable(meta[0]): + if len(meta) > 1 and callable(meta[-1]): sig = signature(meta[0]) params = list(sig.parameters.values()) if len(params) == 2 and len(