pub struct HttpOllamaClient { /* private fields */ }Expand description
Production client that speaks to a real Ollama server over HTTP.
Implementations§
Trait Implementations§
Source§impl OllamaClient for HttpOllamaClient
impl OllamaClient for HttpOllamaClient
Source§fn generate<'life0, 'async_trait>(
&'life0 self,
req: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<GenerateResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate<'life0, 'async_trait>(
&'life0 self,
req: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<GenerateResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Single-turn text completion (
/api/generate).Source§fn chat<'life0, 'async_trait>(
&'life0 self,
req: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat<'life0, 'async_trait>(
&'life0 self,
req: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Multi-turn chat completion (
/api/chat), including tool/function calling.Source§fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Produce dense vector embeddings for one or more texts (
/api/embed).Source§fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ListModelsResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ListModelsResponse, OxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List models available on the Ollama server (
/api/tags).Source§fn stream_generate(&self, req: GenerateRequest) -> BoxStream<GenerateResponse>
fn stream_generate(&self, req: GenerateRequest) -> BoxStream<GenerateResponse>
Stream a generate response token-by-token. Read more
Source§fn stream_chat(&self, req: ChatRequest) -> BoxStream<ChatResponse>
fn stream_chat(&self, req: ChatRequest) -> BoxStream<ChatResponse>
Stream a chat response token-by-token.
Auto Trait Implementations§
impl Freeze for HttpOllamaClient
impl !RefUnwindSafe for HttpOllamaClient
impl Send for HttpOllamaClient
impl Sync for HttpOllamaClient
impl Unpin for HttpOllamaClient
impl UnsafeUnpin for HttpOllamaClient
impl !UnwindSafe for HttpOllamaClient
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