#[non_exhaustive]pub enum AgentError {
Model(ModelError),
Session(SessionError),
Artifact(ArtifactError),
Memory(MemoryError),
Tool {
tool: String,
source: ToolError,
},
Workflow(Box<dyn Error + Send + Sync>),
LlmCallsLimitExceeded {
limit: i32,
},
Cancelled,
DeadlineExceeded,
Config(String),
Compaction(CompactionError),
Other(Box<dyn Error + Send + Sync>),
}Expand description
Errors produced while running agents, callbacks, plugins and tools.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Model(ModelError)
A model call failed.
Session(SessionError)
A session service or state operation failed.
Artifact(ArtifactError)
An artifact service operation failed.
Memory(MemoryError)
A memory service operation failed.
Tool
A tool failed: error tool "<name>" <source>.
Workflow(Box<dyn Error + Send + Sync>)
A workflow error (carries gadk_engine::WorkflowError).
LlmCallsLimitExceeded
The LLM call limit was exceeded: max number of llm calls exceeded: limit is <n>.
Cancelled
The context was cancelled.
DeadlineExceeded
The context’s deadline passed.
Config(String)
Invalid configuration; the message is shown as is.
Compaction(CompactionError)
Context compaction failed; the turn’s own events are already persisted.
Other(Box<dyn Error + Send + Sync>)
Any other error.
Implementations§
Source§impl AgentError
impl AgentError
Sourcepub fn other(msg: impl Into<String>) -> Self
pub fn other(msg: impl Into<String>) -> Self
An AgentError::Other carrying msg.
Sourcepub fn is_compaction(&self) -> bool
pub fn is_compaction(&self) -> bool
Whether this error, or any error it wraps,
is a CompactionError.
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<ArtifactError> for AgentError
impl From<ArtifactError> for AgentError
Source§fn from(source: ArtifactError) -> Self
fn from(source: ArtifactError) -> Self
Converts to this type from the input type.
Source§impl From<MemoryError> for AgentError
impl From<MemoryError> for AgentError
Source§fn from(source: MemoryError) -> Self
fn from(source: MemoryError) -> Self
Converts to this type from the input type.
Source§impl From<ModelError> for AgentError
impl From<ModelError> for AgentError
Source§fn from(source: ModelError) -> Self
fn from(source: ModelError) -> Self
Converts to this type from the input type.
Source§impl From<SessionError> for AgentError
impl From<SessionError> for AgentError
Source§fn from(source: SessionError) -> Self
fn from(source: SessionError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for AgentError
impl !UnwindSafe for AgentError
impl Forget for AgentError
impl Freeze for AgentError
impl Move for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl UnsafeUnpin for AgentErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
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