pub trait ChatProvider: Send + Sync {
// Required methods
fn provider_type(&self) -> ProviderType;
fn name(&self) -> &str;
fn is_available(&self) -> bool;
fn sessions_path(&self) -> Option<PathBuf>;
fn list_sessions(&self) -> Result<Vec<ChatSession>>;
fn import_session(&self, session_id: &str) -> Result<ChatSession>;
fn export_session(&self, session: &ChatSession) -> Result<()>;
}Expand description
Trait for LLM chat providers
Required Methods§
Sourcefn provider_type(&self) -> ProviderType
fn provider_type(&self) -> ProviderType
Get the provider type
Sourcefn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if this provider is available/configured
Sourcefn sessions_path(&self) -> Option<PathBuf>
fn sessions_path(&self) -> Option<PathBuf>
Get the base path where sessions are stored
Sourcefn list_sessions(&self) -> Result<Vec<ChatSession>>
fn list_sessions(&self) -> Result<Vec<ChatSession>>
List all chat sessions from this provider
Sourcefn import_session(&self, session_id: &str) -> Result<ChatSession>
fn import_session(&self, session_id: &str) -> Result<ChatSession>
Import a session from this provider into CSM format
Sourcefn export_session(&self, session: &ChatSession) -> Result<()>
fn export_session(&self, session: &ChatSession) -> Result<()>
Export a CSM session to this provider’s format