pub enum AiProvider {
OpenAi,
Anthropic,
Groq,
OpenRouter,
Together,
Venice,
Ollama,
DeepSeek,
MiniMax,
HuggingFace,
Local,
Custom(String),
}Expand description
AI provider identifier.
Variants§
OpenAi
Anthropic
Groq
OpenRouter
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_with_kv<F>(&self, _alias: &str, kv_getter: &F) -> String
pub fn resolve_api_base_with_kv<F>(&self, _alias: &str, kv_getter: &F) -> String
Resolve API base URL checking KV store too (for custom base_url
config). ADR-0068 §5 clean break: the base URL now lives at
red.config.ai.providers.<provider>.base_url (per provider, no
credential alias). The old red.config.ai.<provider>.<alias>.base_url
shape is rejected on write; see validate_ai_config_key_on_write.
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
Whether this provider offers an embeddings API. Anthropic famously does not; every other provider RedDB speaks does (Local embeds in-process). Used to fail an embeddings task pointer loudly rather than silently re-routing to a different provider (ADR-0068 §5).
Trait Implementations§
Source§impl Clone for AiProvider
impl Clone for AiProvider
Source§fn clone(&self) -> AiProvider
fn clone(&self) -> AiProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AiProvider
impl Debug for AiProvider
impl Eq for AiProvider
Source§impl PartialEq for AiProvider
impl PartialEq for AiProvider
Source§fn eq(&self, other: &AiProvider) -> bool
fn eq(&self, other: &AiProvider) -> bool
Tests for
self and other values to be equal, and is used by ==.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