Home / Function/ test_follow_up() — langchain Function Reference

test_follow_up() — langchain Function Reference

Architecture documentation for the test_follow_up() function in test_self_ask.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5a49e406_c9ef_165c_0095_4800ff384cb3["test_follow_up()"]
  fd5e49f7_25e9_e2c1_8142_fdd27d067ba1["test_self_ask.py"]
  5a49e406_c9ef_165c_0095_4800ff384cb3 -->|defined in| fd5e49f7_25e9_e2c1_8142_fdd27d067ba1
  style 5a49e406_c9ef_165c_0095_4800ff384cb3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/agents/output_parsers/test_self_ask.py lines 6–25

def test_follow_up() -> None:
    """Test follow up parsing."""
    parser = SelfAskOutputParser()
    _input = "Follow up: what is two + 2"
    output = parser.invoke(_input)
    expected_output = AgentAction(
        tool="Intermediate Answer",
        tool_input="what is two + 2",
        log=_input,
    )
    assert output == expected_output
    # Test that also handles one word by default
    _input = "Followup: what is two + 2"
    output = parser.invoke(_input)
    expected_output = AgentAction(
        tool="Intermediate Answer",
        tool_input="what is two + 2",
        log=_input,
    )
    assert output == expected_output

Domain

Subdomains

Frequently Asked Questions

What does test_follow_up() do?
test_follow_up() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_self_ask.py.
Where is test_follow_up() defined?
test_follow_up() is defined in libs/langchain/tests/unit_tests/agents/output_parsers/test_self_ask.py at line 6.

Analyze Your Own Codebase

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

Try Supermodel Free