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§
Sourcefn api_base_url(&self) -> &str
fn api_base_url(&self) -> &str
Get the API base URL
Sourcefn is_authenticated(&self) -> bool
fn is_authenticated(&self) -> bool
Check if the provider is authenticated
Sourcefn set_credentials(
&mut self,
api_key: Option<String>,
session_token: Option<String>,
)
fn set_credentials( &mut self, api_key: Option<String>, session_token: Option<String>, )
Set the API key or session token
Sourcefn list_conversations(
&self,
options: &FetchOptions,
) -> Result<Vec<CloudConversation>>
fn list_conversations( &self, options: &FetchOptions, ) -> Result<Vec<CloudConversation>>
List available conversations
Sourcefn fetch_conversation(&self, id: &str) -> Result<CloudConversation>
fn fetch_conversation(&self, id: &str) -> Result<CloudConversation>
Fetch a single conversation by ID
Sourcefn api_key_env_var(&self) -> &'static str
fn api_key_env_var(&self) -> &'static str
Get the environment variable name for the API key
Provided Methods§
Sourcefn fetch_all_conversations(
&self,
options: &FetchOptions,
) -> Result<Vec<ChatSession>>
fn fetch_all_conversations( &self, options: &FetchOptions, ) -> Result<Vec<ChatSession>>
Fetch all conversations (with messages)
Sourcefn load_api_key_from_env(&self) -> Option<String>
fn load_api_key_from_env(&self) -> Option<String>
Attempt to load API key from environment