pub enum AnthropicFallbacks {
Mode(AnthropicFallbackMode),
Models(Vec<AnthropicFallbackTarget>),
}Expand description
Server-side refusal fallback selection: "default", "off", or an explicit
list of fallback models.
Variants§
Mode(AnthropicFallbackMode)
Models(Vec<AnthropicFallbackTarget>)
Implementations§
Source§impl AnthropicFallbacks
impl AnthropicFallbacks
Sourcepub const MAX_MODELS: usize = 3
pub const MAX_MODELS: usize = 3
Maximum number of explicit fallback entries the API accepts.
Sourcepub fn validation_error(&self, field_path: &str) -> Option<String>
pub fn validation_error(&self, field_path: &str) -> Option<String>
Returns a validation message when an explicit list is empty, too long, has a blank model, or repeats a model.
Sourcepub fn entries_validation_error<'a>(
field_path: &str,
entries: impl ExactSizeIterator<Item = (&'a str, Option<u32>)>,
) -> Option<String>
pub fn entries_validation_error<'a>( field_path: &str, entries: impl ExactSizeIterator<Item = (&'a str, Option<u32>)>, ) -> Option<String>
Validates explicit fallback entries given as (model, max_tokens)
pairs, applying the same rules as the list form of
provider.anthropic.fallbacks. Shared with request-level fallback
lists so both paths reject the same payloads.
Trait Implementations§
Source§impl Clone for AnthropicFallbacks
impl Clone for AnthropicFallbacks
Source§impl Debug for AnthropicFallbacks
impl Debug for AnthropicFallbacks
Source§impl Default for AnthropicFallbacks
impl Default for AnthropicFallbacks
Source§impl<'de> Deserialize<'de> for AnthropicFallbacks
impl<'de> Deserialize<'de> for AnthropicFallbacks
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AnthropicFallbacks
Source§impl JsonSchema for AnthropicFallbacks
impl JsonSchema for AnthropicFallbacks
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for AnthropicFallbacks
impl PartialEq for AnthropicFallbacks
Source§impl Serialize for AnthropicFallbacks
impl Serialize for AnthropicFallbacks
impl StructuralPartialEq for AnthropicFallbacks
Auto Trait Implementations§
impl Freeze for AnthropicFallbacks
impl RefUnwindSafe for AnthropicFallbacks
impl Send for AnthropicFallbacks
impl Sync for AnthropicFallbacks
impl Unpin for AnthropicFallbacks
impl UnsafeUnpin for AnthropicFallbacks
impl UnwindSafe for AnthropicFallbacks
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.