Merge pull request #1088 from langchain-ai/vb/update-return-type

langgraph: add proper type annotation for StateGraph.compile
This commit is contained in:
Nuno Campos
2024-07-23 13:49:12 -07:00
committed by GitHub
+2 -2
View File
@@ -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 []