pub struct Modalities {
pub embed: bool,
pub generate: bool,
pub vision: bool,
pub moderate: bool,
}Expand description
Which modalities a provider+model can serve. Each axis is an
independently testable flag, mirroring the Capabilities shape.
Fields§
§embed: bool§generate: bool§vision: bool§moderate: boolImplementations§
Source§impl Modalities
impl Modalities
Sourcepub const fn conservative() -> Self
pub const fn conservative() -> Self
Conservative defaults for a token the registry has no row for.
An unknown OpenAI-compatible endpoint can plausibly serve the two
universal text modalities — embeddings and generation — but we
must not assume it offers vision (multimodal input) or a
moderation endpoint, since those are specialised products. So a
policy that requests vision/moderate against an undeclared
provider is rejected until the operator supplies an override.
This matches the spirit of Capabilities::conservative: deny
the capabilities you cannot verify.
Sourcepub fn for_provider(token: &str) -> Self
pub fn for_provider(token: &str) -> Self
Built-in modality row for a canonical provider token. Unknown
tokens get Modalities::conservative.
Defaults are rules of thumb based on each provider’s public product surface (overridable per deployment):
- openai: the full matrix — embeddings, chat, gpt-4o vision, and a moderation endpoint.
- anthropic: chat + vision, but no embeddings product and no moderation endpoint.
- minimax: OpenAI-compatible chat, embeddings, and vision (abab multimodal models); no moderation endpoint.
- together / ollama: chat, embeddings, and vision-capable open models; no moderation.
- groq / openrouter / venice: chat + vision, no first-party embeddings, no moderation.
- deepseek: chat only.
- huggingface: raw inference for embeddings + generation; no uniform vision/moderation surface.
- local: embeddings-only backend — generation is out of scope (mirrors the embeddings-only HTTP reject).
- custom / unknown:
Modalities::conservative.
Trait Implementations§
Source§impl Clone for Modalities
impl Clone for Modalities
Source§fn clone(&self) -> Modalities
fn clone(&self) -> Modalities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Modalities
Source§impl Debug for Modalities
impl Debug for Modalities
impl Eq for Modalities
Source§impl PartialEq for Modalities
impl PartialEq for Modalities
Source§fn eq(&self, other: &Modalities) -> bool
fn eq(&self, other: &Modalities) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Modalities
Auto Trait Implementations§
impl Freeze for Modalities
impl RefUnwindSafe for Modalities
impl Send for Modalities
impl Sync for Modalities
impl Unpin for Modalities
impl UnsafeUnpin for Modalities
impl UnwindSafe for Modalities
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request