Trait Provider
Source pub trait Provider: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn model(&self) -> &str;
fn set_model(&mut self, model: String);
fn available_models(&self) -> Vec<String>;
fn context_window(&self) -> u32;
fn fetch_context_window(
&self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + '_>>;
fn fetch_models(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + '_>>;
fn stream(
&self,
messages: &[Message],
system: Option<&str>,
tools: &[ToolDefinition],
max_tokens: u32,
thinking_budget: u32,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<StreamEvent>>> + Send + '_>>;
// Provided methods
fn supports_vision(&self) -> bool { ... }
fn stream_with_model(
&self,
model: &str,
messages: &[Message],
system: Option<&str>,
tools: &[ToolDefinition],
max_tokens: u32,
thinking_budget: u32,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<StreamEvent>>> + Send + '_>> { ... }
}