pub enum AiProvider {
Show 14 variants
OpenAi,
Anthropic,
Groq,
OpenRouter,
OpenAiCompat,
RedRouter,
Together,
Venice,
Ollama,
DeepSeek,
MiniMax,
HuggingFace,
Local,
Custom(String),
}Expand description
AI provider identifier.
Variants§
OpenAi
Anthropic
Groq
OpenRouter
OpenAiCompat
RedRouter
Together
Venice
Ollama
DeepSeek
MiniMax
HuggingFace
Local
Custom(String)
Implementations§
Source§impl AiProvider
impl AiProvider
pub fn token(&self) -> &str
pub fn default_prompt_model(&self) -> &str
pub fn prompt_model_env_name(&self) -> String
pub fn default_embedding_model(&self) -> &str
pub fn default_api_base(&self) -> &str
pub fn api_base_env_name(&self) -> String
pub fn default_key_env_name(&self) -> String
pub fn alias_key_env_name(&self, alias: &str) -> String
pub fn resolve_api_base(&self) -> String
Sourcepub fn resolve_api_base_checked<F>(&self, kv_getter: &F) -> RedDBResult<String>
pub fn resolve_api_base_checked<F>(&self, kv_getter: &F) -> RedDBResult<String>
Resolve and validate the endpoint before any provider credential is read.
Sourcepub fn requires_explicit_endpoint(&self) -> bool
pub fn requires_explicit_endpoint(&self) -> bool
Gateways have no trusted built-in endpoint; registration requires the pair.
Sourcepub fn is_openai_compatible(&self) -> bool
pub fn is_openai_compatible(&self) -> bool
Whether this provider uses the OpenAI-compatible API format.
Sourcepub fn requires_api_key(&self) -> bool
pub fn requires_api_key(&self) -> bool
Whether this provider requires an API key (Ollama/Local don’t).
Sourcepub fn supports_embeddings(&self) -> bool
pub fn supports_embeddings(&self) -> bool
Embeddings routing and policy validation share one modality matrix.
Trait Implementations§
Source§impl Clone for AiProvider
impl Clone for AiProvider
Source§impl Debug for AiProvider
impl Debug for AiProvider
impl Eq for AiProvider
Source§impl PartialEq for AiProvider
impl PartialEq for AiProvider
impl StructuralPartialEq for AiProvider
Auto Trait Implementations§
impl Freeze for AiProvider
impl RefUnwindSafe for AiProvider
impl Send for AiProvider
impl Sync for AiProvider
impl Unpin for AiProvider
impl UnsafeUnpin for AiProvider
impl UnwindSafe for AiProvider
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
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> ⓘ
Converts
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> ⓘ
Converts
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>
Wrap the input message
T in a tonic::Request