Provider

Trait Provider 

Source
pub trait Provider: Sized {
    type Builder: ProviderBuilder;

    const VERIFY_PATH: &'static str;

    // Required method
    fn build<H>(
        builder: &ClientBuilder<Self::Builder, <Self::Builder as ProviderBuilder>::ApiKey, H>,
    ) -> Result<Self>;

    // Provided methods
    fn build_uri(
        &self,
        base_url: &str,
        path: &str,
        _transport: Transport,
    ) -> String { ... }
    fn with_custom(&self, req: Builder) -> Result<Builder> { ... }
}
Expand description

An API provider extension, this abstracts over extensions which may be use in conjunction with the Client<Ext, H> struct to define the behavior of a provider with respect to networking, auth, instantiating models

Required Associated Constants§

Source

const VERIFY_PATH: &'static str

Required Associated Types§

Required Methods§

Source

fn build<H>( builder: &ClientBuilder<Self::Builder, <Self::Builder as ProviderBuilder>::ApiKey, H>, ) -> Result<Self>

Provided Methods§

Source

fn build_uri(&self, base_url: &str, path: &str, _transport: Transport) -> String

Source

fn with_custom(&self, req: Builder) -> Result<Builder>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Provider for AnthropicExt

Source§

const VERIFY_PATH: &'static str = "/v1/models"

Source§

type Builder = AnthropicBuilder

Source§

impl Provider for AzureExt

Source§

impl Provider for CohereExt

Source§

const VERIFY_PATH: &'static str = "/models"

Source§

type Builder = CohereBuilder

Source§

impl Provider for DeepSeekExt

Source§

const VERIFY_PATH: &'static str = "/user/balance"

Source§

type Builder = DeepSeekExtBuilder

Source§

impl Provider for GaladrielExt

Source§

impl Provider for GeminiExt

Source§

const VERIFY_PATH: &'static str = "/v1beta/models"

Source§

type Builder = GeminiBuilder

Source§

impl Provider for GroqExt

Source§

const VERIFY_PATH: &'static str = "/models"

Source§

type Builder = GroqBuilder

Source§

impl Provider for HuggingFaceExt

Source§

const VERIFY_PATH: &'static str = "/api/whoami-v2"

Source§

type Builder = HuggingFaceBuilder

Source§

impl Provider for HyperbolicExt

Source§

const VERIFY_PATH: &'static str = "/models"

Source§

type Builder = HyperbolicBuilder

Source§

impl Provider for MiraExt

Source§

const VERIFY_PATH: &'static str = "/user-credits"

Source§

type Builder = MiraBuilder

Source§

impl Provider for MistralExt

Source§

const VERIFY_PATH: &'static str = "/models"

Source§

type Builder = MistralBuilder

Source§

impl Provider for MoonshotExt

Source§

const VERIFY_PATH: &'static str = "/models"

Source§

type Builder = MoonshotBuilder

Source§

impl Provider for OllamaExt

Source§

const VERIFY_PATH: &'static str = "api/tags"

Source§

type Builder = OllamaBuilder

Source§

impl Provider for OpenAICompletionsExt

Source§

impl Provider for OpenAIResponsesExt

Source§

impl Provider for OpenRouterExt

Source§

impl Provider for PerplexityExt

Source§

impl Provider for TogetherExt

Source§

const VERIFY_PATH: &'static str = "/models"

Source§

type Builder = TogetherExtBuilder

Source§

impl Provider for VoyageExt

Source§

impl Provider for XAiExt

Source§

const VERIFY_PATH: &'static str = "/v1/api-key"

Source§

type Builder = XAiExtBuilder