#[non_exhaustive]pub enum ToolLoopError {
Model(TextModelError),
StepBudgetExhausted {
steps: Vec<StepUsage>,
},
TokenBudgetExhausted {
used: u64,
steps: Vec<StepUsage>,
},
InvalidToolSchema {
tool: String,
reason: String,
},
}Expand description
Why a tool loop stopped without a usable answer (issue #665).
#[non_exhaustive]: the loop is new and its failure set will grow.
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(TextModelError)
The model failed. The wrapped error’s own Display already scrubs
any provider text.
StepBudgetExhausted
The model kept asking for tools and the step budget ran out. The steps recorded so far are kept so a caller can cost or log work that led nowhere.
TokenBudgetExhausted
The model’s calls spent more input + output tokens than the budget
allowed. used is the cumulative total that crossed the limit.
InvalidToolSchema
A tool’s parameters schema could not be honoured: it used a
keyword this validator does not implement (a $ref, a pattern,
an if) or was malformed. Nothing was called.
Trait Implementations§
Source§impl Clone for ToolLoopError
impl Clone for ToolLoopError
Source§impl Debug for ToolLoopError
impl Debug for ToolLoopError
Source§impl Display for ToolLoopError
impl Display for ToolLoopError
impl Eq for ToolLoopError
Source§impl Error for ToolLoopError
impl Error for ToolLoopError
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 PartialEq for ToolLoopError
impl PartialEq for ToolLoopError
impl StructuralPartialEq for ToolLoopError
Auto Trait Implementations§
impl Freeze for ToolLoopError
impl RefUnwindSafe for ToolLoopError
impl Send for ToolLoopError
impl Sync for ToolLoopError
impl Unpin for ToolLoopError
impl UnsafeUnpin for ToolLoopError
impl UnwindSafe for ToolLoopError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.