Home / Function/ after_model() — langchain Function Reference

after_model() — langchain Function Reference

Architecture documentation for the after_model() function in test_decorators.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5db83528_8e08_d7fe_e2fc_f806b038e621["after_model()"]
  cd353dda_0cce_b520_4569_96a6f4d126f2["JumpMiddleware"]
  5db83528_8e08_d7fe_e2fc_f806b038e621 -->|defined in| cd353dda_0cce_b520_4569_96a6f4d126f2
  16ca7528_7a30_3e96_9e48_703331613607["test_after_model_decorator()"]
  16ca7528_7a30_3e96_9e48_703331613607 -->|calls| 5db83528_8e08_d7fe_e2fc_f806b038e621
  a07be0fe_4b9e_17f0_8a15_c277b29b23dc["test_hook_config_decorator_on_class_method()"]
  a07be0fe_4b9e_17f0_8a15_c277b29b23dc -->|calls| 5db83528_8e08_d7fe_e2fc_f806b038e621
  5c88a110_55b4_19f3_cd4f_de7e2c7696da["test_can_jump_to_with_after_model_decorator()"]
  5c88a110_55b4_19f3_cd4f_de7e2c7696da -->|calls| 5db83528_8e08_d7fe_e2fc_f806b038e621
  dbbbbc55_121d_9eaa_f841_4cf280580fa5["test_async_after_model_decorator()"]
  dbbbbc55_121d_9eaa_f841_4cf280580fa5 -->|calls| 5db83528_8e08_d7fe_e2fc_f806b038e621
  f9888611_d125_5daf_5c6a_47f2c8a52c83["test_async_after_model_preserves_can_jump_to()"]
  f9888611_d125_5daf_5c6a_47f2c8a52c83 -->|calls| 5db83528_8e08_d7fe_e2fc_f806b038e621
  5c25d42d_8717_6afd_6929_7361aee18580["test_async_middleware_with_can_jump_to_graph_snapshot()"]
  5c25d42d_8717_6afd_6929_7361aee18580 -->|calls| 5db83528_8e08_d7fe_e2fc_f806b038e621
  style 5db83528_8e08_d7fe_e2fc_f806b038e621 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_decorators.py lines 202–205

        def after_model(
            self, state: AgentState[Any], runtime: Runtime[None]
        ) -> dict[str, Any] | None:
            return {"jump_to": "tools"}

Domain

Subdomains

Frequently Asked Questions

What does after_model() do?
after_model() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_decorators.py.
Where is after_model() defined?
after_model() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_decorators.py at line 202.
What calls after_model()?
after_model() is called by 6 function(s): test_after_model_decorator, test_async_after_model_decorator, test_async_after_model_preserves_can_jump_to, test_async_middleware_with_can_jump_to_graph_snapshot, test_can_jump_to_with_after_model_decorator, test_hook_config_decorator_on_class_method.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free