CloudProvider

Trait CloudProvider 

Source
pub trait CloudProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn api_base_url(&self) -> &str;
    fn is_authenticated(&self) -> bool;
    fn set_credentials(
        &mut self,
        api_key: Option<String>,
        session_token: Option<String>,
    );
    fn list_conversations(
        &self,
        options: &FetchOptions,
    ) -> Result<Vec<CloudConversation>>;
    fn fetch_conversation(&self, id: &str) -> Result<CloudConversation>;
    fn api_key_env_var(&self) -> &'static str;

    // Provided methods
    fn fetch_all_conversations(
        &self,
        options: &FetchOptions,
    ) -> Result<Vec<ChatSession>> { ... }
    fn load_api_key_from_env(&self) -> Option<String> { ... }
}
Expand description

Trait for cloud provider implementations

Required Methods§

Source

fn name(&self) -> &'static str

Get the provider name

Source

fn api_base_url(&self) -> &str

Get the API base URL

Source

fn is_authenticated(&self) -> bool

Check if the provider is authenticated

Source

fn set_credentials( &mut self, api_key: Option<String>, session_token: Option<String>, )

Set the API key or session token

Source

fn list_conversations( &self, options: &FetchOptions, ) -> Result<Vec<CloudConversation>>

List available conversations

Source

fn fetch_conversation(&self, id: &str) -> Result<CloudConversation>

Fetch a single conversation by ID

Source

fn api_key_env_var(&self) -> &'static str

Get the environment variable name for the API key

Provided Methods§

Source

fn fetch_all_conversations( &self, options: &FetchOptions, ) -> Result<Vec<ChatSession>>

Fetch all conversations (with messages)

Source

fn load_api_key_from_env(&self) -> Option<String>

Attempt to load API key from environment

Implementors§