Skip to content

Commit cf3e825

Browse files
authored
feat(docs): warn that StateGraph is a builder class (#6417)
1 parent 7a5e3c1 commit cf3e825

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libs/langgraph/langgraph/graph/state.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
117117
will be used to aggregate the values of that key received from multiple nodes.
118118
The signature of a reducer function is `(Value, Value) -> Value`.
119119
120+
!!! warning
121+
122+
`StateGraph` is a builder class and cannot be used directly for execution.
123+
You must first call `.compile()` to create an executable graph that supports
124+
methods like `invoke()`, `stream()`, `astream()`, and `ainvoke()`. See the
125+
`CompiledStateGraph` documentation for more details.
126+
120127
Args:
121128
state_schema: The schema class that defines the state.
122129
context_schema: The schema class that defines the runtime context.

0 commit comments

Comments
 (0)