pub struct LlmConfigBuilder { /* private fields */ }Expand description
Builder for LlmConfig.
Implementations§
Source§impl LlmConfigBuilder
impl LlmConfigBuilder
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
Set the base URL of the LLM endpoint. Required.
Sourcepub fn api_key(self, api_key: impl Into<String>) -> Self
pub fn api_key(self, api_key: impl Into<String>) -> Self
Set the API key. Optional for local providers.
Sourcepub fn num_ctx(self, num_ctx: u32) -> Self
pub fn num_ctx(self, num_ctx: u32) -> Self
Set the context window size sent in the options.num_ctx field of
Ollama requests. Defaults to 4096. Ignored by OpenAI-compatible and
Anthropic providers; use max_tokens for those.
Sourcepub fn max_tokens(self, max_tokens: u32) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
Set the maximum number of generated tokens sent in the max_tokens
field of OpenAI-compatible and Anthropic requests. Defaults to 4096.
Ignored by Ollama; use num_ctx for that.
Trait Implementations§
Source§impl Default for LlmConfigBuilder
impl Default for LlmConfigBuilder
Source§fn default() -> LlmConfigBuilder
fn default() -> LlmConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LlmConfigBuilder
impl RefUnwindSafe for LlmConfigBuilder
impl Send for LlmConfigBuilder
impl Sync for LlmConfigBuilder
impl Unpin for LlmConfigBuilder
impl UnsafeUnpin for LlmConfigBuilder
impl UnwindSafe for LlmConfigBuilder
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