pub struct ChatOllama { /* private fields */ }Expand description
Ollama implementation
Implementations§
Source§impl ChatOllama
impl ChatOllama
Sourcepub fn new(model: impl Into<String>) -> ChatOllama
pub fn new(model: impl Into<String>) -> ChatOllama
Sourcepub fn with_base_url(self, url: impl Into<String>) -> ChatOllama
pub fn with_base_url(self, url: impl Into<String>) -> ChatOllama
Trait Implementations§
Source§impl ChatModel for ChatOllama
impl ChatModel for ChatOllama
Source§fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
options: Option<&'life2 CallOptions>,
) -> Pin<Box<dyn Future<Output = Result<Message, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ChatOllama: 'async_trait,
fn invoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
options: Option<&'life2 CallOptions>,
) -> Pin<Box<dyn Future<Output = Result<Message, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ChatOllama: 'async_trait,
Invoke the model with messages Read more
Source§fn stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
options: Option<&'life2 CallOptions>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<MessageChunk, LlmError>> + Send + 'life0>>, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ChatOllama: 'async_trait,
fn stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
options: Option<&'life2 CallOptions>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<MessageChunk, LlmError>> + Send + 'life0>>, LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ChatOllama: 'async_trait,
Stream the model’s response Read more
Source§fn bind_tools(&self, tools: Vec<ToolDefinition>) -> ChatOllama
fn bind_tools(&self, tools: Vec<ToolDefinition>) -> ChatOllama
Bind tools to this model instance Read more
Source§fn with_structured_output<T>(self) -> StructuredOutputModel<ChatOllama, T>
fn with_structured_output<T>(self) -> StructuredOutputModel<ChatOllama, T>
Convert to structured output model Read more
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name
Source§impl Clone for ChatOllama
impl Clone for ChatOllama
Source§fn clone(&self) -> ChatOllama
fn clone(&self) -> ChatOllama
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChatOllama
impl !RefUnwindSafe for ChatOllama
impl Send for ChatOllama
impl Sync for ChatOllama
impl Unpin for ChatOllama
impl UnsafeUnpin for ChatOllama
impl !UnwindSafe for ChatOllama
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