mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-22 07:32:25 +02:00
If the state schema uses validators, skip the model construct optimization. For context, pydantic state can be significantly slower to run than typed dict and dataclass states due to the full recursive validation. We have some optimizations to reduce the impact of this (using cached validators with model_construct), but this doesn't handle things like field_validator. We prefer correctness over performance, obviously. Resolves: https://github.com/langchain-ai/langgraph/issues/4074 Signed-off-by: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com>