pub enum Provider {
OpenAI,
Anthropic,
OpenRouter,
}Expand description
Supported LLM providers.
Variants§
OpenAI
OpenAI (GPT-4, GPT-3.5, etc.)
Anthropic
Anthropic (Claude 3, etc.)
OpenRouter
OpenRouter (100+ models)
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn auth_header(&self) -> &'static str
pub fn auth_header(&self) -> &'static str
Get the header name for the API key.
Sourcepub fn format_auth(&self, api_key: &str) -> String
pub fn format_auth(&self, api_key: &str) -> String
Format the API key for the authorization header.
Sourcepub fn extra_headers(&self) -> Vec<(&'static str, &'static str)>
pub fn extra_headers(&self) -> Vec<(&'static str, &'static str)>
Get additional required headers for this provider.
Sourcepub fn is_openai_compatible(&self) -> bool
pub fn is_openai_compatible(&self) -> bool
Check if this provider uses OpenAI-compatible format.
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>,
Deserialize this value from the given Serde deserializer. Read more
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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more