From d00503ecc40f2bc49787a61187f7315dc4b66cc7 Mon Sep 17 00:00:00 2001 From: vbarda Date: Mon, 22 Jul 2024 18:03:16 -0400 Subject: [PATCH] langgraph: add proper type annotation for StateGraph.compile --- libs/langgraph/langgraph/graph/state.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/langgraph/langgraph/graph/state.py b/libs/langgraph/langgraph/graph/state.py index 96ad8e513..d04f06135 100644 --- a/libs/langgraph/langgraph/graph/state.py +++ b/libs/langgraph/langgraph/graph/state.py @@ -371,7 +371,7 @@ class StateGraph(Graph): interrupt_before: Optional[Union[All, Sequence[str]]] = None, interrupt_after: Optional[Union[All, Sequence[str]]] = None, debug: bool = False, - ) -> CompiledGraph: + ) -> "CompiledStateGraph": """Compiles the state graph into a `CompiledGraph` object. The compiled graph implements the `Runnable` interface and can be invoked, @@ -386,7 +386,7 @@ class StateGraph(Graph): debug (bool): A flag indicating whether to enable debug mode. Returns: - CompiledGraph: The compiled state graph. + CompiledStateGraph: The compiled state graph. """ # assign default values interrupt_before = interrupt_before or []