pub struct LlmAgentBuilder { /* private fields */ }Expand description
Builder for constructing an LlmAgent with fluent API.
Implementations§
Source§impl LlmAgentBuilder
impl LlmAgentBuilder
Sourcepub fn new(name: impl Into<String>, model: impl Into<String>) -> LlmAgentBuilder
pub fn new(name: impl Into<String>, model: impl Into<String>) -> LlmAgentBuilder
Create a new LlmAgentBuilder
Sourcepub fn with_api_key(self, api_key: impl Into<String>) -> LlmAgentBuilder
pub fn with_api_key(self, api_key: impl Into<String>) -> LlmAgentBuilder
Set the API key for the LLM provider
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> LlmAgentBuilder
pub fn with_system_prompt(self, prompt: impl Into<String>) -> LlmAgentBuilder
Set the system prompt for the agent
Sourcepub fn with_temperature(self, temperature: f32) -> LlmAgentBuilder
pub fn with_temperature(self, temperature: f32) -> LlmAgentBuilder
Set the temperature for generation (0.0 - 2.0)
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> LlmAgentBuilder
pub fn with_max_tokens(self, max_tokens: u32) -> LlmAgentBuilder
Set the maximum number of tokens to generate
Sourcepub fn with_memory(self, memory: Arc<dyn Memory>) -> LlmAgentBuilder
pub fn with_memory(self, memory: Arc<dyn Memory>) -> LlmAgentBuilder
Set the memory backend
Auto Trait Implementations§
impl Freeze for LlmAgentBuilder
impl !RefUnwindSafe for LlmAgentBuilder
impl Send for LlmAgentBuilder
impl Sync for LlmAgentBuilder
impl Unpin for LlmAgentBuilder
impl !UnwindSafe for LlmAgentBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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