test_valid_action_and_answer_raises_exception() — langchain Function Reference
Architecture documentation for the test_valid_action_and_answer_raises_exception() function in test_mrkl.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 4c21af1e_5484_6b2f_503b_ae0b7fc6f538["test_valid_action_and_answer_raises_exception()"] 11e4d0ce_1ab2_b50d_7115_96011ca80049["test_mrkl.py"] 4c21af1e_5484_6b2f_503b_ae0b7fc6f538 -->|defined in| 11e4d0ce_1ab2_b50d_7115_96011ca80049 893a0b31_0a99_6756_3281_2a5a05606fe2["get_action_and_input()"] 4c21af1e_5484_6b2f_503b_ae0b7fc6f538 -->|calls| 893a0b31_0a99_6756_3281_2a5a05606fe2 style 4c21af1e_5484_6b2f_503b_ae0b7fc6f538 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/test_mrkl.py lines 131–142
def test_valid_action_and_answer_raises_exception() -> None:
"""Test handling when both an action and answer are found."""
llm_output = (
"Thought: I need to search for NBA\n"
"Action: Search\n"
"Action Input: NBA\n"
"Observation: founded in 1994\n"
"Thought: I can now answer the question\n"
"Final Answer: 1994"
)
with pytest.raises(OutputParserException):
get_action_and_input(llm_output)
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does test_valid_action_and_answer_raises_exception() do?
test_valid_action_and_answer_raises_exception() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_mrkl.py.
Where is test_valid_action_and_answer_raises_exception() defined?
test_valid_action_and_answer_raises_exception() is defined in libs/langchain/tests/unit_tests/agents/test_mrkl.py at line 131.
What does test_valid_action_and_answer_raises_exception() call?
test_valid_action_and_answer_raises_exception() 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