pub struct OutputParserException {
pub message: String,
pub error_code: ErrorCode,
pub observation: Option<String>,
pub llm_output: Option<String>,
pub send_to_llm: bool,
}
Expand description
Output parser exception with special handling for LLM feedback
Fields§
§message: String
Error message
error_code: ErrorCode
Error code
observation: Option<String>
Observation that can be sent to the model
llm_output: Option<String>
LLM output that caused the error
send_to_llm: bool
Whether to send context back to the LLM
Implementations§
Source§impl OutputParserException
impl OutputParserException
Sourcepub fn with_code(message: impl Into<String>, error_code: ErrorCode) -> Self
pub fn with_code(message: impl Into<String>, error_code: ErrorCode) -> Self
Create a new output parser exception with error code
Sourcepub fn with_llm_context(
message: impl Into<String>,
observation: Option<String>,
llm_output: Option<String>,
send_to_llm: bool,
) -> Self
pub fn with_llm_context( message: impl Into<String>, observation: Option<String>, llm_output: Option<String>, send_to_llm: bool, ) -> Self
Create a new output parser exception with LLM feedback context
Sourcepub fn observation(&self) -> Option<&str>
pub fn observation(&self) -> Option<&str>
Get the observation for LLM feedback
Sourcepub fn llm_output(&self) -> Option<&str>
pub fn llm_output(&self) -> Option<&str>
Get the LLM output that caused the error
Sourcepub fn should_send_to_llm(&self) -> bool
pub fn should_send_to_llm(&self) -> bool
Check if this error should be sent back to the LLM
Trait Implementations§
Source§impl Debug for OutputParserException
impl Debug for OutputParserException
Source§impl Display for OutputParserException
impl Display for OutputParserException
Source§impl Error for OutputParserException
impl Error for OutputParserException
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<OutputParserException> for FerricLinkError
impl From<OutputParserException> for FerricLinkError
Source§fn from(source: OutputParserException) -> Self
fn from(source: OutputParserException) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OutputParserException
impl RefUnwindSafe for OutputParserException
impl Send for OutputParserException
impl Sync for OutputParserException
impl Unpin for OutputParserException
impl UnwindSafe for OutputParserException
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoFerricLinkError for Twhere
T: Display,
impl<T> IntoFerricLinkError for Twhere
T: Display,
Source§fn into_ferriclink_error(self) -> FerricLinkError
fn into_ferriclink_error(self) -> FerricLinkError
Convert to FerricLinkError
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.