before_model() — langchain Function Reference
Architecture documentation for the before_model() function in test_wrap_model_call.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 8f5d866e_cfd6_528f_2636_be74f4ef1e28["before_model()"] 784d6d35_d2e6_dbe1_b0cc_28d564aa53df["MixedMiddleware"] 8f5d866e_cfd6_528f_2636_be74f4ef1e28 -->|defined in| 784d6d35_d2e6_dbe1_b0cc_28d564aa53df a19c0a5c_ca2b_3869_ab7a_70d066eca849["test_sync_invoke_with_mixed_middleware()"] a19c0a5c_ca2b_3869_ab7a_70d066eca849 -->|calls| 8f5d866e_cfd6_528f_2636_be74f4ef1e28 style 8f5d866e_cfd6_528f_2636_be74f4ef1e28 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py lines 1496–1497
def before_model(self, state: AgentState[Any], runtime: Runtime[Any]) -> None:
calls.append("MixedMiddleware.before_model")
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does before_model() do?
before_model() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py.
Where is before_model() defined?
before_model() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py at line 1496.
What calls before_model()?
before_model() is called by 1 function(s): test_sync_invoke_with_mixed_middleware.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free