pub enum CapabilityError {
ModalityUnsupported {
model: String,
kind: MediaKind,
},
SourceKindUnsupported {
model: String,
kind: MediaKind,
attempted: SourceKind,
accepted: EnumSet<SourceKind>,
},
FormatUnsupported {
model: String,
kind: MediaKind,
format: String,
accepted: Vec<&'static str>,
},
SizeExceeded {
model: String,
kind: MediaKind,
bytes: u64,
max: u64,
},
UnknownModel {
model: String,
kind: MediaKind,
},
}Expand description
Reasons a request can fail capability validation, by precision.
Returned from
LanguageModelProvider::validate_request
and surfaced both at the application boundary (predict / direct
generate) and at the application configuration preflight (where
the same validation runs against the declared schema rather than
the actual values).
Variants§
ModalityUnsupported
The model has no MediaSupport entry for this modality at all.
SourceKindUnsupported
The model accepts this modality but not via this source kind.
accepted enumerates what would work. The field is named
attempted (rather than source) so thiserror doesn’t try to
treat it as an Error::source() provider — it’s a discriminant,
not a chained error.
FormatUnsupported
The model accepts this modality + source but not this MIME subtype (e.g. JPEG image submitted to a model that only takes PNG).
SizeExceeded
InlineBytes payload exceeds the model’s declared cap.
UnknownModel
The capability table has no entry for model at all — the model
is either too new (unmodeled) or misspelled. Surfaced when a
non-text content part is sent against an unknown model. Pure
text calls do not produce this; they bypass capability lookup.
Trait Implementations§
Source§impl Clone for CapabilityError
impl Clone for CapabilityError
Source§fn clone(&self) -> CapabilityError
fn clone(&self) -> CapabilityError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CapabilityError
impl Debug for CapabilityError
Source§impl Display for CapabilityError
impl Display for CapabilityError
impl Eq for CapabilityError
Source§impl Error for CapabilityError
impl Error for CapabilityError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for CapabilityError
impl PartialEq for CapabilityError
impl StructuralPartialEq for CapabilityError
Auto Trait Implementations§
impl Freeze for CapabilityError
impl RefUnwindSafe for CapabilityError
impl Send for CapabilityError
impl Sync for CapabilityError
impl Unpin for CapabilityError
impl UnsafeUnpin for CapabilityError
impl UnwindSafe for CapabilityError
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
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,
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
key and return true if they are equal.