Exceptions¶
langchain_core.exceptions.OutputParserException
¶
Bases: ValueError
, LangChainException
Exception that output parsers should raise to signify a parsing error.
This exists to differentiate parsing errors from other code or execution errors
that also may arise inside the output parser. OutputParserException
will be
available to catch and handle in ways to fix the parsing error, while other
errors will be raised.
METHOD | DESCRIPTION |
---|---|
__init__ |
Create an |
__init__
¶
__init__(
error: Any,
observation: str | None = None,
llm_output: str | None = None,
send_to_llm: bool = False,
)
Create an OutputParserException
.
PARAMETER | DESCRIPTION |
---|---|
error
|
The error that's being re-raised or an error message.
TYPE:
|
observation
|
String explanation of error which can be passed to a model to try and remediate the issue.
TYPE:
|
llm_output
|
String model output which is error-ing.
TYPE:
|
send_to_llm
|
Whether to send the observation and llm_output back to an Agent
after an
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If |