pub struct ModelsDevClient { /* private fields */ }Expand description
Client for the models.dev API.
Implementations§
Source§impl ModelsDevClient
impl ModelsDevClient
Sourcepub fn with_url(api_url: String) -> Self
pub fn with_url(api_url: String) -> Self
Create a new client with a custom API URL (for testing).
Sourcepub async fn fetch_providers(&self) -> Result<Vec<DiscoveredProvider>>
pub async fn fetch_providers(&self) -> Result<Vec<DiscoveredProvider>>
Fetch all providers and their models from models.dev.
Sourcepub async fn fetch_providers_cached(
&self,
force_refresh: bool,
) -> Result<Vec<DiscoveredProvider>>
pub async fn fetch_providers_cached( &self, force_refresh: bool, ) -> Result<Vec<DiscoveredProvider>>
Fetch all providers from the local cache when available, otherwise from models.dev.
Sourcepub async fn fetch_provider_models(
&self,
provider_id: &str,
) -> Result<Vec<DiscoveredModel>>
pub async fn fetch_provider_models( &self, provider_id: &str, ) -> Result<Vec<DiscoveredModel>>
Fetch a specific provider’s models.
Sourcepub async fn fetch_provider_models_cached(
&self,
provider_id: &str,
force_refresh: bool,
) -> Result<Vec<DiscoveredModel>>
pub async fn fetch_provider_models_cached( &self, provider_id: &str, force_refresh: bool, ) -> Result<Vec<DiscoveredModel>>
Fetch a provider’s models through the models.dev cache.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelsDevClient
impl !RefUnwindSafe for ModelsDevClient
impl Send for ModelsDevClient
impl Sync for ModelsDevClient
impl Unpin for ModelsDevClient
impl UnsafeUnpin for ModelsDevClient
impl !UnwindSafe for ModelsDevClient
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