Home / Function/ test_agent_graph_with_jump_to_end_as_after_agent() — langchain Function Reference

test_agent_graph_with_jump_to_end_as_after_agent() — langchain Function Reference

Architecture documentation for the test_agent_graph_with_jump_to_end_as_after_agent() function in test_framework.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  be0cd5a4_9570_ba6b_5732_5308ca1f3a9a["test_agent_graph_with_jump_to_end_as_after_agent()"]
  8310d669_2524_e019_e333_8473b50a4990["test_framework.py"]
  be0cd5a4_9570_ba6b_5732_5308ca1f3a9a -->|defined in| 8310d669_2524_e019_e333_8473b50a4990
  1ce8d842_781b_35a8_8aae_44bd2c3e3f46["before_agent()"]
  be0cd5a4_9570_ba6b_5732_5308ca1f3a9a -->|calls| 1ce8d842_781b_35a8_8aae_44bd2c3e3f46
  53cfff0b_c0cc_ffd2_649b_70806af6e30a["after_agent()"]
  be0cd5a4_9570_ba6b_5732_5308ca1f3a9a -->|calls| 53cfff0b_c0cc_ffd2_649b_70806af6e30a
  style be0cd5a4_9570_ba6b_5732_5308ca1f3a9a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_framework.py lines 219–247

def test_agent_graph_with_jump_to_end_as_after_agent(snapshot: SnapshotAssertion) -> None:
    @tool
    def my_tool(input_string: str) -> str:
        """A great tool."""
        return input_string

    class NoopZero(AgentMiddleware):
        @hook_config(can_jump_to=["end"])
        def before_agent(self, state: AgentState[Any], runtime: Runtime) -> None:
            return None

    class NoopOne(AgentMiddleware):
        def after_agent(self, state: AgentState[Any], runtime: Runtime) -> None:
            return None

    class NoopTwo(AgentMiddleware):
        def after_agent(self, state: AgentState[Any], runtime: Runtime) -> None:
            return None

    agent_one = create_agent(
        model=FakeToolCallingModel(
            tool_calls=[[ToolCall(id="1", name="my_tool", args={"input": "yo"})]],
        ),
        tools=[my_tool],
        system_prompt="You are a helpful assistant.",
        middleware=[NoopZero(), NoopOne(), NoopTwo()],
    )

    assert agent_one.get_graph().draw_mermaid() == snapshot

Domain

Subdomains

Frequently Asked Questions

What does test_agent_graph_with_jump_to_end_as_after_agent() do?
test_agent_graph_with_jump_to_end_as_after_agent() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_framework.py.
Where is test_agent_graph_with_jump_to_end_as_after_agent() defined?
test_agent_graph_with_jump_to_end_as_after_agent() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_framework.py at line 219.
What does test_agent_graph_with_jump_to_end_as_after_agent() call?
test_agent_graph_with_jump_to_end_as_after_agent() calls 2 function(s): after_agent, before_agent.

Analyze Your Own Codebase

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

Try Supermodel Free