test_agent_graph_without_return_direct_tools() — langchain Function Reference
Architecture documentation for the test_agent_graph_without_return_direct_tools() function in test_return_direct_graph.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b0c1d45c_c65d_797b_d6e1_1416d2ea924e["test_agent_graph_without_return_direct_tools()"] 038e0dbf_bd54_0b67_ae80_b2983f5ccff8["test_return_direct_graph.py"] b0c1d45c_c65d_797b_d6e1_1416d2ea924e -->|defined in| 038e0dbf_bd54_0b67_ae80_b2983f5ccff8 style b0c1d45c_c65d_797b_d6e1_1416d2ea924e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/test_return_direct_graph.py lines 10–27
def test_agent_graph_without_return_direct_tools(snapshot: SnapshotAssertion) -> None:
"""Test that graph WITHOUT return_direct tools does NOT have edge from tools to end."""
@tool
def normal_tool(input_string: str) -> str:
"""A normal tool without return_direct."""
return input_string
agent = create_agent(
model=FakeToolCallingModel(),
tools=[normal_tool],
system_prompt="You are a helpful assistant.",
)
# The mermaid diagram should NOT include an edge from tools to __end__
# when no tools have return_direct=True
mermaid_diagram = agent.get_graph().draw_mermaid()
assert mermaid_diagram == snapshot
Domain
Subdomains
Source
Frequently Asked Questions
What does test_agent_graph_without_return_direct_tools() do?
test_agent_graph_without_return_direct_tools() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/test_return_direct_graph.py.
Where is test_agent_graph_without_return_direct_tools() defined?
test_agent_graph_without_return_direct_tools() is defined in libs/langchain_v1/tests/unit_tests/agents/test_return_direct_graph.py at line 10.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free