pub enum AiProvider {
OpenAi,
Anthropic,
Groq,
OpenRouter,
Together,
Venice,
Ollama,
DeepSeek,
HuggingFace,
Local,
Custom(String),
}Expand description
AI provider identifier.
Variants§
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).
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).
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
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 Eq 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<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