mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-29 04:55:09 +02:00
feat(docs): warn that StateGraph is a builder class (#6417)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user