pub struct OllamaProvider { /* private fields */ }
Expand description
Ollama provider implementation (for local models)
Implementations§
Source§impl OllamaProvider
impl OllamaProvider
Sourcepub fn new(config: LLMProviderConfig) -> LLMResult<Self>
pub fn new(config: LLMProviderConfig) -> LLMResult<Self>
Create new Ollama provider
Trait Implementations§
Source§impl Debug for OllamaProvider
impl Debug for OllamaProvider
Source§impl LLMProvider for OllamaProvider
impl LLMProvider for OllamaProvider
Source§fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<LLMResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
_request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<LLMResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate a response for the given request Read more
Source§fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<Vec<ModelInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<Vec<ModelInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List available models for this provider
Source§fn capabilities(&self) -> &LLMCapabilities
fn capabilities(&self) -> &LLMCapabilities
Get provider capabilities
Source§fn get_model_info<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = LLMResult<ModelInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_model_info<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = LLMResult<ModelInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get information about a specific model
Source§fn supports_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn supports_model<'life0, 'life1, 'async_trait>(
&'life0 self,
model: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a model is supported
Source§fn estimate_tokens(&self, text: &str) -> usize
fn estimate_tokens(&self, text: &str) -> usize
Estimate token count for text (optional override)
Source§fn validate_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 LLMRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate a request before sending
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check for the provider
Source§fn handle_create_message<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<CreateMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_create_message<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
) -> Pin<Box<dyn Future<Output = LLMResult<CreateMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle MCP CreateMessageRequest (adapts to LLM types) Read more
Auto Trait Implementations§
impl Freeze for OllamaProvider
impl RefUnwindSafe for OllamaProvider
impl Send for OllamaProvider
impl Sync for OllamaProvider
impl Unpin for OllamaProvider
impl UnwindSafe for OllamaProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more