ModelCallLimitState Class — langchain Architecture
Architecture documentation for the ModelCallLimitState class in model_call_limit.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD e21a5f90_5d2d_c896_325f_a1f244bbfbd7["ModelCallLimitState"] cd424b61_a87c_1279_2846_1393c1806d7b["model_call_limit.py"] e21a5f90_5d2d_c896_325f_a1f244bbfbd7 -->|defined in| cd424b61_a87c_1279_2846_1393c1806d7b
Relationship Graph
Source Code
libs/langchain_v1/langchain/agents/middleware/model_call_limit.py lines 24–34
class ModelCallLimitState(AgentState[ResponseT]):
"""State schema for `ModelCallLimitMiddleware`.
Extends `AgentState` with model call tracking fields.
Type Parameters:
ResponseT: The type of the structured response. Defaults to `Any`.
"""
thread_model_call_count: NotRequired[Annotated[int, PrivateStateAttr]]
run_model_call_count: NotRequired[Annotated[int, UntrackedValue, PrivateStateAttr]]
Source
Frequently Asked Questions
What is the ModelCallLimitState class?
ModelCallLimitState is a class in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/model_call_limit.py.
Where is ModelCallLimitState defined?
ModelCallLimitState is defined in libs/langchain_v1/langchain/agents/middleware/model_call_limit.py at line 24.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free