test_action() — langchain Function Reference
Architecture documentation for the test_action() function in test_react_json_single_input.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD eb41c0d9_2234_b7c7_83c8_70a1d61134a7["test_action()"] 693f10e9_0670_0fc2_07b5_f6aa601250db["test_react_json_single_input.py"] eb41c0d9_2234_b7c7_83c8_70a1d61134a7 -->|defined in| 693f10e9_0670_0fc2_07b5_f6aa601250db style eb41c0d9_2234_b7c7_83c8_70a1d61134a7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/output_parsers/test_react_json_single_input.py lines 8–25
def test_action() -> None:
"""Test standard parsing of action/action input."""
parser = ReActJsonSingleInputOutputParser()
_input = """Thought: agent thought here
```
{
"action": "search",
"action_input": "what is the temperature in SF?"
}
```
"""
output = parser.invoke(_input)
expected_output = AgentAction(
tool="search",
tool_input="what is the temperature in SF?",
log=_input,
)
assert output == expected_output
Domain
Subdomains
Source
Frequently Asked Questions
What does test_action() do?
test_action() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_react_json_single_input.py.
Where is test_action() defined?
test_action() is defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_react_json_single_input.py at line 8.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free