Home / Function/ test_get_action_and_input_sql_query() — langchain Function Reference

test_get_action_and_input_sql_query() — langchain Function Reference

Architecture documentation for the test_get_action_and_input_sql_query() function in test_mrkl.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  bb77e2d3_0783_9884_cb51_329107c616bf["test_get_action_and_input_sql_query()"]
  11e4d0ce_1ab2_b50d_7115_96011ca80049["test_mrkl.py"]
  bb77e2d3_0783_9884_cb51_329107c616bf -->|defined in| 11e4d0ce_1ab2_b50d_7115_96011ca80049
  893a0b31_0a99_6756_3281_2a5a05606fe2["get_action_and_input()"]
  bb77e2d3_0783_9884_cb51_329107c616bf -->|calls| 893a0b31_0a99_6756_3281_2a5a05606fe2
  style bb77e2d3_0783_9884_cb51_329107c616bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/agents/test_mrkl.py lines 72–88

def test_get_action_and_input_sql_query() -> None:
    """Test when the LLM output is a well-formed SQL query.

    Test getting the action and action input from the text
    when the LLM output is a well formed SQL query.
    """
    llm_output = """
    I should query for the largest single shift payment for every unique user.
    Action: query_sql_db
    Action Input: \
    SELECT "UserName", MAX(totalpayment) FROM user_shifts GROUP BY "UserName" """
    action, action_input = get_action_and_input(llm_output)
    assert action == "query_sql_db"
    assert (
        action_input
        == 'SELECT "UserName", MAX(totalpayment) FROM user_shifts GROUP BY "UserName"'
    )

Domain

Subdomains

Frequently Asked Questions

What does test_get_action_and_input_sql_query() do?
test_get_action_and_input_sql_query() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_mrkl.py.
Where is test_get_action_and_input_sql_query() defined?
test_get_action_and_input_sql_query() is defined in libs/langchain/tests/unit_tests/agents/test_mrkl.py at line 72.
What does test_get_action_and_input_sql_query() call?
test_get_action_and_input_sql_query() calls 1 function(s): get_action_and_input.

Analyze Your Own Codebase

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

Try Supermodel Free