test_tool_usage() — langchain Function Reference
Architecture documentation for the test_tool_usage() function in test_json.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 797392d9_87ff_d009_07e3_22b0a0bf78b5["test_tool_usage()"] 67815222_b543_3a57_2b15_f724f1404204["test_json.py"] 797392d9_87ff_d009_07e3_22b0a0bf78b5 -->|defined in| 67815222_b543_3a57_2b15_f724f1404204 style 797392d9_87ff_d009_07e3_22b0a0bf78b5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/output_parsers/test_json.py lines 6–16
def test_tool_usage() -> None:
parser = JSONAgentOutputParser()
_input = """ ```
{
"action": "search",
"action_input": "2+2"
}
```"""
output = parser.invoke(_input)
expected_output = AgentAction(tool="search", tool_input="2+2", log=_input)
assert output == expected_output
Domain
Subdomains
Source
Frequently Asked Questions
What does test_tool_usage() do?
test_tool_usage() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_json.py.
Where is test_tool_usage() defined?
test_tool_usage() is defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_json.py at line 6.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free