mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-21 22:29:51 +00:00
better error message on parsing errors (#11342)
This commit is contained in:
parent
b3c83fdd33
commit
bdf865d8e8
@ -931,7 +931,12 @@ class AgentExecutor(Chain):
|
|||||||
else:
|
else:
|
||||||
raise_error = False
|
raise_error = False
|
||||||
if raise_error:
|
if raise_error:
|
||||||
raise e
|
raise ValueError(
|
||||||
|
"An output parsing error occurred. "
|
||||||
|
"In order to pass this error back to the agent and have it try "
|
||||||
|
"again, pass `handle_parsing_errors=True` to the AgentExecutor. "
|
||||||
|
f"This is the error: {str(e)}"
|
||||||
|
)
|
||||||
text = str(e)
|
text = str(e)
|
||||||
if isinstance(self.handle_parsing_errors, bool):
|
if isinstance(self.handle_parsing_errors, bool):
|
||||||
if e.send_to_llm:
|
if e.send_to_llm:
|
||||||
@ -1027,7 +1032,12 @@ class AgentExecutor(Chain):
|
|||||||
else:
|
else:
|
||||||
raise_error = False
|
raise_error = False
|
||||||
if raise_error:
|
if raise_error:
|
||||||
raise e
|
raise ValueError(
|
||||||
|
"An output parsing error occurred. "
|
||||||
|
"In order to pass this error back to the agent and have it try "
|
||||||
|
"again, pass `handle_parsing_errors=True` to the AgentExecutor. "
|
||||||
|
f"This is the error: {str(e)}"
|
||||||
|
)
|
||||||
text = str(e)
|
text = str(e)
|
||||||
if isinstance(self.handle_parsing_errors, bool):
|
if isinstance(self.handle_parsing_errors, bool):
|
||||||
if e.send_to_llm:
|
if e.send_to_llm:
|
||||||
|
Loading…
Reference in New Issue
Block a user