feat(docs): warn that StateGraph is a builder class (#6417)

This commit is contained in:
Mason Daugherty
2025-11-07 21:09:15 -05:00
committed by GitHub
parent 7a5e3c1e79
commit cf3e8252f5
+7
View File
@@ -117,6 +117,13 @@ class StateGraph(Generic[StateT, ContextT, InputT, OutputT]):
will be used to aggregate the values of that key received from multiple nodes.
The signature of a reducer function is `(Value, Value) -> Value`.
!!! warning
`StateGraph` is a builder class and cannot be used directly for execution.
You must first call `.compile()` to create an executable graph that supports
methods like `invoke()`, `stream()`, `astream()`, and `ainvoke()`. See the
`CompiledStateGraph` documentation for more details.
Args:
state_schema: The schema class that defines the state.
context_schema: The schema class that defines the runtime context.