Struct OllamaBuilder
pub struct OllamaBuilder { /* private fields */ }Expand description
Typed builder for OllamaModelProvider.
Only alias is required. base_url defaults to the module-level
BASE_URL constant (bare http://localhost:11434), api_key is
treated as absent when empty/whitespace, and reasoning_enabled
stays None (thinking-mode determined by the served model) unless
explicitly toggled.
Implementations§
Source§impl OllamaBuilder
impl OllamaBuilder
Sourcepub fn base_url(self, base_url: Option<&str>) -> OllamaBuilder
pub fn base_url(self, base_url: Option<&str>) -> OllamaBuilder
Override the Ollama server base URL. None (the default) uses
the module-level BASE_URL constant (http://localhost:11434);
Some("") / whitespace-only input is preserved as an empty
base URL (matching the pre-builder behaviour — useful for tests
that inject a mock server via a full endpoint URL and want the
provider’s base_url field to stay literally empty). Trailing
/ and /api[...] suffixes are normalized identically to the
pre-builder ctor.
Sourcepub fn api_key(self, api_key: Option<&str>) -> OllamaBuilder
pub fn api_key(self, api_key: Option<&str>) -> OllamaBuilder
Explicit API key. Whitespace-only inputs are treated as absent.
Sourcepub fn reasoning_enabled(self, reasoning_enabled: Option<bool>) -> OllamaBuilder
pub fn reasoning_enabled(self, reasoning_enabled: Option<bool>) -> OllamaBuilder
Override reasoning-mode routing. None (the default) lets the
runtime probe the served model; Some(true) / Some(false)
pins the behaviour.
Sourcepub fn tuning(self, tuning: OllamaTuning) -> OllamaBuilder
pub fn tuning(self, tuning: OllamaTuning) -> OllamaBuilder
Override the per-deployment tuning knobs (num_ctx, num_predict,
temperature_override). When unset, defaults to
OllamaTuning::default.
pub fn build(self) -> OllamaModelProvider
Auto Trait Implementations§
impl Freeze for OllamaBuilder
impl RefUnwindSafe for OllamaBuilder
impl Send for OllamaBuilder
impl Sync for OllamaBuilder
impl Unpin for OllamaBuilder
impl UnsafeUnpin for OllamaBuilder
impl UnwindSafe for OllamaBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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>
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