pub struct OllamaBackend { /* private fields */ }Implementations§
Source§impl OllamaBackend
impl OllamaBackend
Sourcepub fn new(cfg: OllamaConfig) -> Result<Self>
pub fn new(cfg: OllamaConfig) -> Result<Self>
Creates a new instance.
Trait Implementations§
Source§impl LlmBackend for OllamaBackend
impl LlmBackend for OllamaBackend
Source§fn embed(&self, texts: &[String]) -> Result<Vec<Vec<f32>>>
fn embed(&self, texts: &[String]) -> Result<Vec<Vec<f32>>>
Embed a batch of texts. Returns one vector per input, all of the same
dimensionality (
embed_dim).Source§fn generate(&self, system: &str, prompt: &str) -> Result<String>
fn generate(&self, system: &str, prompt: &str) -> Result<String>
Free-form completion used for structured extraction.
system sets the
instruction; prompt carries the chunk. Implementations should request
non-streaming output.Auto Trait Implementations§
impl !Freeze for OllamaBackend
impl !RefUnwindSafe for OllamaBackend
impl !Sync for OllamaBackend
impl !UnwindSafe for OllamaBackend
impl Send for OllamaBackend
impl Unpin for OllamaBackend
impl UnsafeUnpin for OllamaBackend
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more