test_agent_lookup_tool() — langchain Function Reference
Architecture documentation for the test_agent_lookup_tool() function in test_agent.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD fbdfb834_051d_ad0b_c089_af65bf95e2f2["test_agent_lookup_tool()"] 47a7b285_8e60_f78f_282d_429958c446fa["test_agent.py"] fbdfb834_051d_ad0b_c089_af65bf95e2f2 -->|defined in| 47a7b285_8e60_f78f_282d_429958c446fa style fbdfb834_051d_ad0b_c089_af65bf95e2f2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/test_agent.py lines 404–423
def test_agent_lookup_tool() -> None:
"""Test agent lookup tool."""
fake_llm = FakeListLLM(
responses=["FooBarBaz\nAction: Search\nAction Input: misalignment"],
)
tools = [
Tool(
name="Search",
func=lambda x: x,
description="Useful for searching",
return_direct=True,
),
]
agent = initialize_agent(
tools=tools,
llm=fake_llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
)
assert agent.lookup_tool("Search") == tools[0]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_agent_lookup_tool() do?
test_agent_lookup_tool() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_agent.py.
Where is test_agent_lookup_tool() defined?
test_agent_lookup_tool() is defined in libs/langchain/tests/unit_tests/agents/test_agent.py at line 404.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free