mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-10 23:41:28 +00:00
Harrison/output error (#3094)
Co-authored-by: yummydum <sumita@nowcast.co.jp>
This commit is contained in:
@@ -9,7 +9,7 @@ from langchain.agents.mrkl.output_parser import MRKLOutputParser
|
||||
from langchain.agents.mrkl.prompt import FORMAT_INSTRUCTIONS, PREFIX, SUFFIX
|
||||
from langchain.agents.tools import Tool
|
||||
from langchain.prompts import PromptTemplate
|
||||
from langchain.schema import AgentAction
|
||||
from langchain.schema import AgentAction, OutputParserException
|
||||
from tests.unit_tests.llms.fake_llm import FakeLLM
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ def test_get_final_answer_multiline() -> None:
|
||||
def test_bad_action_input_line() -> None:
|
||||
"""Test handling when no action input found."""
|
||||
llm_output = "Thought: I need to search for NBA\n" "Action: Search\n" "Thought: NBA"
|
||||
with pytest.raises(ValueError):
|
||||
with pytest.raises(OutputParserException):
|
||||
get_action_and_input(llm_output)
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ def test_bad_action_line() -> None:
|
||||
llm_output = (
|
||||
"Thought: I need to search for NBA\n" "Thought: Search\n" "Action Input: NBA"
|
||||
)
|
||||
with pytest.raises(ValueError):
|
||||
with pytest.raises(OutputParserException):
|
||||
get_action_and_input(llm_output)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user