pub enum Provider {
OpenAI,
Anthropic,
Google,
}Expand description
Supported LLM providers
Variants§
Implementations§
Source§impl Provider
impl Provider
Sourcepub const fn default_model(&self) -> &'static str
pub const fn default_model(&self) -> &'static str
Default model for complex analysis tasks
Sourcepub const fn default_fast_model(&self) -> &'static str
pub const fn default_fast_model(&self) -> &'static str
Fast model for simple tasks (status updates, parsing)
Sourcepub const fn context_window(&self) -> usize
pub const fn context_window(&self) -> usize
Context window size (max tokens)
Sourcepub const fn api_key_env(&self) -> &'static str
pub const fn api_key_env(&self) -> &'static str
Environment variable name for the API key
Sourcepub fn api_key_prefixes(&self) -> &'static [&'static str]
pub fn api_key_prefixes(&self) -> &'static [&'static str]
Valid API key prefixes for format validation
Returns the expected prefixes for the provider’s API keys.
OpenAI has multiple valid prefixes (sk-, sk-proj-).
Sourcepub const fn api_key_prefix(&self) -> Option<&'static str>
pub const fn api_key_prefix(&self) -> Option<&'static str>
Expected API key prefix for basic format validation (primary prefix)
Returns the primary expected prefix for display in error messages.
Sourcepub fn validate_api_key_format(&self, key: &str) -> Result<(), String>
pub fn validate_api_key_format(&self, key: &str) -> Result<(), String>
Validate API key format
Performs basic validation to catch obvious misconfigurations:
- Checks for expected prefix (
OpenAI:sk-orsk-proj-,Anthropic:sk-ant-) - Ensures key is not suspiciously short
Returns Ok(()) if valid, or a warning message if potentially invalid.
Note: A valid format doesn’t guarantee the key works - it may still be
expired or revoked. This just catches typos.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Provider
impl<'de> Deserialize<'de> for Provider
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>,
impl Copy for Provider
impl Eq for Provider
impl StructuralPartialEq for Provider
Auto Trait Implementations§
impl Freeze for Provider
impl RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnwindSafe for Provider
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
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> 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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.