pub struct Client { /* private fields */ }Expand description
Ollama API client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Create a new client builder.
Sourcepub async fn chat(&self, request: ChatRequest) -> Result<ChatResponse>
pub async fn chat(&self, request: ChatRequest) -> Result<ChatResponse>
Generate a chat completion.
Sourcepub async fn generate(
&self,
request: GenerateRequest,
) -> Result<GenerateResponse>
pub async fn generate( &self, request: GenerateRequest, ) -> Result<GenerateResponse>
Generate a completion (non-chat).
Sourcepub async fn list_models(&self) -> Result<ModelList>
pub async fn list_models(&self) -> Result<ModelList>
List available models.
Sourcepub async fn show_model(&self, name: &str) -> Result<ModelInfo>
pub async fn show_model(&self, name: &str) -> Result<ModelInfo>
Get information about a specific model.
Sourcepub async fn pull_model(&self, name: &str) -> Result<()>
pub async fn pull_model(&self, name: &str) -> Result<()>
Pull a model from the registry.
Sourcepub async fn delete_model(&self, name: &str) -> Result<()>
pub async fn delete_model(&self, name: &str) -> Result<()>
Delete a model.
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if Ollama is running.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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