Skip to main content

ProviderAdmin

Trait ProviderAdmin 

pub trait ProviderAdmin: Send + Sync {
    // Required methods
    fn get_config(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<ProviderSnapshot, ModelError>> + Send + '_>>;
    fn set_config(
        &self,
        expected_revision: String,
        config: ProviderConfig,
    ) -> Pin<Box<dyn Future<Output = Result<ProviderSnapshot, ModelError>> + Send + '_>>;
    fn credential_status(
        &self,
        profile_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<CredentialStatus, ModelError>> + Send + '_>>;
    fn list_models(
        &self,
        profile_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ModelDescriptor>, ModelError>> + Send + '_>>;
    fn set_api_key(
        &self,
        profile_id: String,
        api_key: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>;
    fn remove_api_key(
        &self,
        profile_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>;
    fn migrate_api_key(
        &self,
        profile_id: String,
        original_endpoint: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>;
    fn remove_legacy_api_key(
        &self,
        profile_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>;
}
Expand description

An explicitly granted capability, not part of an ordinary model session. Hosts bind the authenticated user before providing this interface. Every operation remains subject to backend authorization and durable-write checks. Dropping a mutation abandons its response, not its durable commit. Refresh configuration/status before deciding whether an interrupted write needs retry.

Required Methods§

fn get_config( &self, ) -> Pin<Box<dyn Future<Output = Result<ProviderSnapshot, ModelError>> + Send + '_>>

fn set_config( &self, expected_revision: String, config: ProviderConfig, ) -> Pin<Box<dyn Future<Output = Result<ProviderSnapshot, ModelError>> + Send + '_>>

fn credential_status( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<CredentialStatus, ModelError>> + Send + '_>>

fn list_models( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<ModelDescriptor>, ModelError>> + Send + '_>>

The models the provider lists, asked with its stored credential: also the proof that the endpoint and credential work. crate::protocol::ErrorKind::Unsupported when it lists none.

fn set_api_key( &self, profile_id: String, api_key: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

fn remove_api_key( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

fn migrate_api_key( &self, profile_id: String, original_endpoint: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

fn remove_legacy_api_key( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

Implementations on Foreign Types§

§

impl<T> ProviderAdmin for AdministrationClient<T>
where T: Transport,

§

fn get_config( &self, ) -> Pin<Box<dyn Future<Output = Result<ProviderSnapshot, ModelError>> + Send + '_>>

§

fn set_config( &self, expected_revision: String, config: ProviderConfig, ) -> Pin<Box<dyn Future<Output = Result<ProviderSnapshot, ModelError>> + Send + '_>>

§

fn credential_status( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<CredentialStatus, ModelError>> + Send + '_>>

§

fn list_models( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<ModelDescriptor>, ModelError>> + Send + '_>>

§

fn set_api_key( &self, profile_id: String, api_key: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

§

fn remove_api_key( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

§

fn migrate_api_key( &self, profile_id: String, original_endpoint: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

§

fn remove_legacy_api_key( &self, profile_id: String, ) -> Pin<Box<dyn Future<Output = Result<(), ModelError>> + Send + '_>>

Implementors§