Skip to main content

SignIn

Trait SignIn 

Source
pub trait SignIn:
    WasmCompatSend
    + WasmCompatSync
    + 'static {
    // Required methods
    fn handler(
        &self,
        spec: &ModelSpec,
        transport: &Transport,
    ) -> Option<Result<ErasedHandler, ConnectError>>;
    fn plan(&self, spec: &ModelSpec) -> Option<&'static str>;
}
Expand description

A way to reach catalog models no key is set for, such as a subscription plan signed in to. A Connector asks it for a model only when the provider registered for the model’s vendor, else the environment, has no key for it.

Required Methods§

Source

fn handler( &self, spec: &ModelSpec, transport: &Transport, ) -> Option<Result<ErasedHandler, ConnectError>>

The handler serving spec with the signed-in credential, or None when this sign-in does not serve spec now. A handler that sends HTTP sends through transport.

Source

fn plan(&self, spec: &ModelSpec) -> Option<&'static str>

The name of the subscription plan through which this sign-in would serve spec, such as "ChatGPT", whether or not the user is signed in; for model pickers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§