pub enum AgentRunError {
Show 14 variants
Model(ModelError),
Tool(ToolError),
OutputValidationFailed(OutputValidationError),
OutputParseFailed(OutputParseError),
UsageLimitExceeded(UsageLimitError),
UnexpectedStop,
NoOutput,
MaxRetriesExceeded {
message: String,
},
Serialization(Error),
Configuration(String),
Cancelled,
Timeout {
seconds: u64,
},
Provider(String),
Other(Error),
}Expand description
Errors that can occur during agent run execution.
Variants§
Model(ModelError)
Model returned an error.
Tool(ToolError)
Tool execution failed.
OutputValidationFailed(OutputValidationError)
Output validation failed after retries.
OutputParseFailed(OutputParseError)
Failed to parse model output.
UsageLimitExceeded(UsageLimitError)
Usage limit was exceeded.
UnexpectedStop
Model stopped without producing output.
NoOutput
No output was produced after all steps.
MaxRetriesExceeded
Maximum retries exceeded.
Serialization(Error)
Serialization/deserialization error.
Configuration(String)
Configuration error.
Cancelled
Agent was cancelled.
Timeout
Timeout occurred.
Provider(String)
Provider error.
Other(Error)
Other error.
Implementations§
Source§impl AgentRunError
impl AgentRunError
Sourcepub fn max_retries(message: impl Into<String>) -> Self
pub fn max_retries(message: impl Into<String>) -> Self
Create a max retries error.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable.
Trait Implementations§
Source§impl Debug for AgentRunError
impl Debug for AgentRunError
Source§impl Display for AgentRunError
impl Display for AgentRunError
Source§impl Error for AgentRunError
impl Error for AgentRunError
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<Error> for AgentRunError
impl From<Error> for AgentRunError
Source§impl From<Error> for AgentRunError
impl From<Error> for AgentRunError
Source§impl From<ModelError> for AgentRunError
impl From<ModelError> for AgentRunError
Source§fn from(source: ModelError) -> Self
fn from(source: ModelError) -> Self
Converts to this type from the input type.
Source§impl From<ToolError> for AgentRunError
impl From<ToolError> for AgentRunError
Source§impl From<UsageLimitError> for AgentRunError
impl From<UsageLimitError> for AgentRunError
Source§fn from(source: UsageLimitError) -> Self
fn from(source: UsageLimitError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AgentRunError
impl !RefUnwindSafe for AgentRunError
impl Send for AgentRunError
impl Sync for AgentRunError
impl Unpin for AgentRunError
impl !UnwindSafe for AgentRunError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.