pub struct AutomationConfig {Show 17 fields
pub goal: String,
pub max_steps: usize,
pub timeout_ms: u64,
pub recovery_strategy: RecoveryStrategy,
pub max_retries: usize,
pub use_cache: bool,
pub capture_screenshots: bool,
pub success_urls: Vec<String>,
pub success_patterns: Vec<String>,
pub extract_on_success: bool,
pub extraction_prompt: Option<String>,
pub capture_profile: CaptureProfile,
pub retry_policy: RetryPolicy,
pub model_policy: ModelPolicy,
pub system_prompt: Option<String>,
pub system_prompt_extra: Option<String>,
pub user_message_extra: Option<String>,
}Expand description
Main automation configuration.
Fields§
§goal: StringThe goal to achieve.
max_steps: usizeMaximum number of steps before stopping.
timeout_ms: u64Timeout in milliseconds.
recovery_strategy: RecoveryStrategyRecovery strategy for failures.
max_retries: usizeMaximum retries per step.
use_cache: boolWhether to use selector cache.
capture_screenshots: boolWhether to capture screenshots after each step.
success_urls: Vec<String>URLs that indicate success.
success_patterns: Vec<String>Text patterns that indicate success.
extract_on_success: boolWhether to extract data on success.
extraction_prompt: Option<String>Extraction prompt for final data.
capture_profile: CaptureProfileCapture profile.
retry_policy: RetryPolicyRetry policy.
model_policy: ModelPolicyModel policy.
system_prompt: Option<String>Optional system prompt for automation.
system_prompt_extra: Option<String>Optional extra system instructions.
user_message_extra: Option<String>Optional extra user message instructions.
Implementations§
Source§impl AutomationConfig
impl AutomationConfig
Sourcepub fn with_max_steps(self, steps: usize) -> Self
pub fn with_max_steps(self, steps: usize) -> Self
Set maximum steps.
Sourcepub fn with_timeout(self, ms: u64) -> Self
pub fn with_timeout(self, ms: u64) -> Self
Set timeout in milliseconds.
Sourcepub fn with_recovery(self, strategy: RecoveryStrategy) -> Self
pub fn with_recovery(self, strategy: RecoveryStrategy) -> Self
Set recovery strategy.
Sourcepub fn with_retries(self, retries: usize) -> Self
pub fn with_retries(self, retries: usize) -> Self
Set max retries.
Sourcepub fn with_cache(self, enabled: bool) -> Self
pub fn with_cache(self, enabled: bool) -> Self
Enable/disable selector cache.
Sourcepub fn with_screenshots(self, enabled: bool) -> Self
pub fn with_screenshots(self, enabled: bool) -> Self
Enable/disable screenshots.
Sourcepub fn with_success_url(self, url: impl Into<String>) -> Self
pub fn with_success_url(self, url: impl Into<String>) -> Self
Add a success URL pattern.
Sourcepub fn with_success_pattern(self, pattern: impl Into<String>) -> Self
pub fn with_success_pattern(self, pattern: impl Into<String>) -> Self
Add a success text pattern.
Sourcepub fn with_extraction(self, prompt: impl Into<String>) -> Self
pub fn with_extraction(self, prompt: impl Into<String>) -> Self
Enable extraction on success.
Sourcepub fn with_capture_profile(self, profile: CaptureProfile) -> Self
pub fn with_capture_profile(self, profile: CaptureProfile) -> Self
Set capture profile.
Sourcepub fn with_retry_policy(self, policy: RetryPolicy) -> Self
pub fn with_retry_policy(self, policy: RetryPolicy) -> Self
Set retry policy.
Sourcepub fn with_model_policy(self, policy: ModelPolicy) -> Self
pub fn with_model_policy(self, policy: ModelPolicy) -> Self
Set model policy.
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_system_prompt_extra(self, extra: impl Into<String>) -> Self
pub fn with_system_prompt_extra(self, extra: impl Into<String>) -> Self
Set extra system instructions.
Sourcepub fn with_user_message_extra(self, extra: impl Into<String>) -> Self
pub fn with_user_message_extra(self, extra: impl Into<String>) -> Self
Set extra user message instructions.
Sourcepub fn timeout_duration(&self) -> Duration
pub fn timeout_duration(&self) -> Duration
Get timeout as Duration.
Sourcepub fn is_success_url(&self, url: &str) -> bool
pub fn is_success_url(&self, url: &str) -> bool
Check if a URL matches success criteria.
Sourcepub fn matches_success_pattern(&self, text: &str) -> bool
pub fn matches_success_pattern(&self, text: &str) -> bool
Check if text matches success criteria.
Trait Implementations§
Source§impl Clone for AutomationConfig
impl Clone for AutomationConfig
Source§fn clone(&self) -> AutomationConfig
fn clone(&self) -> AutomationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more