pub enum AgentError {
Provider(ProviderError),
Tool(ToolError),
NoResponse,
EmptyResponse,
MaxTokensExceeded,
ContentFiltered,
ToolDenied(String),
ToolNotFound(String),
InvalidToolInput(String),
PermissionFailed(String),
UnexpectedStopReason(String),
Context(ContextError),
}Expand description
Errors that can occur during agent execution
Variants§
Provider(ProviderError)
Model provider errors (API calls, authentication, rate limits)
Tool(ToolError)
Tool execution errors
NoResponse
Model returned no text response
EmptyResponse
Model returned empty response with no content
MaxTokensExceeded
Response exceeded maximum token limit
ContentFiltered
Response was filtered by content moderation
ToolDenied(String)
Tool execution was denied by user or policy
ToolNotFound(String)
Tool not found
InvalidToolInput(String)
Invalid tool input from model
PermissionFailed(String)
Permission request failed
UnexpectedStopReason(String)
Unexpected stop reason from model
Context(ContextError)
Context file loading error
Trait Implementations§
Source§impl Debug for AgentError
impl Debug for AgentError
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
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<AgentError> for Error
impl From<AgentError> for Error
Source§fn from(err: AgentError) -> Self
fn from(err: AgentError) -> Self
Converts to this type from the input type.
Source§impl From<ContextError> for AgentError
impl From<ContextError> for AgentError
Source§fn from(source: ContextError) -> Self
fn from(source: ContextError) -> Self
Converts to this type from the input type.
Source§impl From<ProviderError> for AgentError
impl From<ProviderError> for AgentError
Source§fn from(source: ProviderError) -> Self
fn from(source: ProviderError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AgentError
impl !RefUnwindSafe for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl !UnwindSafe for AgentError
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