pub enum ProviderType {
OpenAI,
XAI,
Anthropic,
Gemini,
Custom(String),
}Expand description
Provider type for external API transformations.
Different providers have different API formats and requirements.
None (when used as Option<ProviderType>) means native/passthrough —
no transformation needed (local SGLang backends).
Variants§
OpenAI
OpenAI API — strip SGLang-specific fields.
XAI
xAI/Grok — special handling for input items.
Anthropic
Anthropic Claude — different API format.
Gemini
Google Gemini — special logprobs handling.
Custom(String)
Custom provider with string identifier.
Implementations§
Source§impl ProviderType
impl ProviderType
Sourcepub fn from_url(url: &str) -> Option<Self>
pub fn from_url(url: &str) -> Option<Self>
Detect provider from URL host.
Returns None for URLs that don’t match known providers or can’t be parsed.
Sourcepub fn admin_key_env_var(&self) -> Option<&'static str>
pub fn admin_key_env_var(&self) -> Option<&'static str>
Environment variable name for per-provider admin API key (model discovery).
Returns None for Custom providers since there’s no known env var.
Sourcepub fn uses_x_api_key(&self) -> bool
pub fn uses_x_api_key(&self) -> bool
Whether this provider uses x-api-key header instead of Authorization: Bearer.
Sourcepub fn from_model_name(model: &str) -> Option<Self>
pub fn from_model_name(model: &str) -> Option<Self>
Detect provider from model name (heuristic fallback).
Returns None for models that don’t match known external providers.
Trait Implementations§
Source§impl Clone for ProviderType
impl Clone for ProviderType
Source§fn clone(&self) -> ProviderType
fn clone(&self) -> ProviderType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderType
impl Debug for ProviderType
Source§impl<'de> Deserialize<'de> for ProviderType
impl<'de> Deserialize<'de> for ProviderType
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>,
Source§impl Display for ProviderType
impl Display for ProviderType
Source§impl Hash for ProviderType
impl Hash for ProviderType
Source§impl JsonSchema for ProviderType
impl JsonSchema for ProviderType
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for ProviderType
impl PartialEq for ProviderType
Source§impl Serialize for ProviderType
impl Serialize for ProviderType
impl Eq for ProviderType
impl StructuralPartialEq for ProviderType
Auto Trait Implementations§
impl Freeze for ProviderType
impl RefUnwindSafe for ProviderType
impl Send for ProviderType
impl Sync for ProviderType
impl Unpin for ProviderType
impl UnsafeUnpin for ProviderType
impl UnwindSafe for ProviderType
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§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.