Struct ModelRefusalError
pub struct ModelRefusalError {
pub requested_model: String,
pub category: Option<String>,
pub usage: Option<Box<TokenUsage>>,
pub attempted_candidate: Option<String>,
pub attempted_candidate_index: Option<usize>,
}Expand description
A provider safety refusal that completed at the transport layer but cannot be accepted as an assistant response.
The optional usage belongs to the refusing attempt. It is carried on the
typed cause so reliability and turn accounting can bill that work without
treating it as accepted-response context usage. category is diagnostic
metadata only and must not be rendered to users.
Fields§
§requested_model: StringModel requested on the refusing attempt.
category: Option<String>Refusal category token, when the provider supplied one.
usage: Option<Box<TokenUsage>>Normalized usage billed by the refusing attempt.
attempted_candidate: Option<String>Exact reliability candidate that emitted a streamed refusal.
Leaf providers leave this unset. Composite providers fill it while forwarding a stream so a non-streaming recovery can skip exactly the already-billed candidate.
attempted_candidate_index: Option<usize>Position of that candidate in the active reliability domain.
This disambiguates same-profile fallback models, which intentionally share one configured candidate/cooldown identity.
Trait Implementations§
Source§impl Clone for ModelRefusalError
impl Clone for ModelRefusalError
Source§fn clone(&self) -> ModelRefusalError
fn clone(&self) -> ModelRefusalError
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelRefusalError
impl Debug for ModelRefusalError
Source§impl Display for ModelRefusalError
impl Display for ModelRefusalError
Source§impl Error for ModelRefusalError
impl Error for ModelRefusalError
1.30.0 · §fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · §fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Box<ModelRefusalError>> for StreamError
impl From<Box<ModelRefusalError>> for StreamError
Source§fn from(source: Box<ModelRefusalError>) -> StreamError
fn from(source: Box<ModelRefusalError>) -> StreamError
Auto Trait Implementations§
impl Freeze for ModelRefusalError
impl RefUnwindSafe for ModelRefusalError
impl Send for ModelRefusalError
impl Sync for ModelRefusalError
impl Unpin for ModelRefusalError
impl UnsafeUnpin for ModelRefusalError
impl UnwindSafe for ModelRefusalError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more