pub struct ProviderRegistration {
pub id: String,
pub name: Option<String>,
pub api: String,
pub base_url: Option<String>,
pub auth_env: Vec<String>,
pub auth_header: AuthHeaderMode,
pub oauth: bool,
pub headers: IndexMap<String, String>,
pub compat: Option<JsonValue>,
pub models: ProviderModels,
}Expand description
A provider component’s registration (extension-api §4.4).
Fields§
§id: StringProvider id (openrouter).
name: Option<String>Display name.
api: StringAPI the component implements for this provider.
base_url: Option<String>Default base URL of the provider’s models.
auth_env: Vec<String>Environment variables holding an API key, in lookup order.
auth_header: AuthHeaderModeInformational for the component (see crate docs: core only injects
Authorization for models.json / override authHeader: true).
oauth: boolThe component supports OAuth login/refresh.
headers: IndexMap<String, String>Provider headers used by the component.
compat: Option<JsonValue>Provider compatibility flags applied to every model.
models: ProviderModelsModel list.
Implementations§
Source§impl ProviderRegistration
impl ProviderRegistration
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Display name (name, else id).
Sourcepub fn has_api_key_auth(&self) -> bool
pub fn has_api_key_auth(&self) -> bool
Whether the provider offers API-key auth: every registration does unless it is
OAuth-only (oauth: true without authEnv).
Trait Implementations§
Source§impl Clone for ProviderRegistration
impl Clone for ProviderRegistration
Source§impl Debug for ProviderRegistration
impl Debug for ProviderRegistration
Source§impl<'de> Deserialize<'de> for ProviderRegistration
impl<'de> Deserialize<'de> for ProviderRegistration
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
Source§impl PartialEq for ProviderRegistration
impl PartialEq for ProviderRegistration
Source§impl Serialize for ProviderRegistration
impl Serialize for ProviderRegistration
impl StructuralPartialEq for ProviderRegistration
Auto Trait Implementations§
impl Freeze for ProviderRegistration
impl RefUnwindSafe for ProviderRegistration
impl Send for ProviderRegistration
impl Sync for ProviderRegistration
impl Unpin for ProviderRegistration
impl UnsafeUnpin for ProviderRegistration
impl UnwindSafe for ProviderRegistration
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