Home / Function/ test_action() — langchain Function Reference

test_action() — langchain Function Reference

Architecture documentation for the test_action() function in test_react_single_input.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8c10add8_06b0_0cb8_f5f1_e03c2c0b89a0["test_action()"]
  d02558d7_3d60_16fd_ff0e_bce803d6a351["test_react_single_input.py"]
  8c10add8_06b0_0cb8_f5f1_e03c2c0b89a0 -->|defined in| d02558d7_3d60_16fd_ff0e_bce803d6a351
  style 8c10add8_06b0_0cb8_f5f1_e03c2c0b89a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/agents/output_parsers/test_react_single_input.py lines 10–22

def test_action() -> None:
    """Test standard parsing of action/action input."""
    parser = ReActSingleInputOutputParser()
    _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

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_single_input.py.
Where is test_action() defined?
test_action() is defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_react_single_input.py at line 10.

Analyze Your Own Codebase

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

Try Supermodel Free