pub struct AgentConfig {
pub system_prompt: Option<String>,
pub max_concurrent_llm_calls: usize,
pub temperature: f32,
pub max_tokens: u16,
pub timeout: Duration,
pub retry: RetryConfig,
pub html_max_bytes: usize,
pub html_cleaning: HtmlCleaningMode,
pub json_mode: bool,
pub limits: UsageLimits,
}Expand description
Agent configuration.
Fields§
§system_prompt: Option<String>System prompt for LLM.
max_concurrent_llm_calls: usizeMax concurrent LLM calls.
temperature: f32LLM temperature (0.0 - 1.0).
max_tokens: u16Max tokens for LLM response.
timeout: DurationRequest timeout.
retry: RetryConfigRetry configuration.
html_max_bytes: usizeMax HTML bytes to send to LLM.
html_cleaning: HtmlCleaningModeHTML cleaning mode.
json_mode: boolWhether to request JSON output from LLM.
limits: UsageLimitsUsage limits for resource control.
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Set system prompt.
Sourcepub fn with_max_concurrent_llm_calls(self, n: usize) -> Self
pub fn with_max_concurrent_llm_calls(self, n: usize) -> Self
Set max concurrent LLM calls.
Sourcepub fn with_temperature(self, temp: f32) -> Self
pub fn with_temperature(self, temp: f32) -> Self
Set LLM temperature.
Sourcepub fn with_max_tokens(self, tokens: u16) -> Self
pub fn with_max_tokens(self, tokens: u16) -> Self
Set max tokens.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set request timeout.
Sourcepub fn with_retry(self, retry: RetryConfig) -> Self
pub fn with_retry(self, retry: RetryConfig) -> Self
Set retry config.
Sourcepub fn with_html_max_bytes(self, bytes: usize) -> Self
pub fn with_html_max_bytes(self, bytes: usize) -> Self
Set HTML max bytes.
Sourcepub fn with_html_cleaning(self, mode: HtmlCleaningMode) -> Self
pub fn with_html_cleaning(self, mode: HtmlCleaningMode) -> Self
Set HTML cleaning mode.
Sourcepub fn with_json_mode(self, enabled: bool) -> Self
pub fn with_json_mode(self, enabled: bool) -> Self
Enable or disable JSON mode.
Sourcepub fn with_limits(self, limits: UsageLimits) -> Self
pub fn with_limits(self, limits: UsageLimits) -> Self
Set usage limits.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentConfig
impl Debug for AgentConfig
Auto Trait Implementations§
impl Freeze for AgentConfig
impl RefUnwindSafe for AgentConfig
impl Send for AgentConfig
impl Sync for AgentConfig
impl Unpin for AgentConfig
impl UnwindSafe for AgentConfig
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