pub struct AgentSpawner { /* private fields */ }Expand description
Spawner for AI agents
Implementations§
Source§impl AgentSpawner
impl AgentSpawner
Sourcepub fn with_working_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_working_dir(self, dir: impl Into<PathBuf>) -> Self
Set default working directory
Sourcepub fn with_env_vars(self, vars: HashMap<String, String>) -> Self
pub fn with_env_vars(self, vars: HashMap<String, String>) -> Self
Set environment variables
Sourcepub fn with_auto_restart(self, enabled: bool) -> Self
pub fn with_auto_restart(self, enabled: bool) -> Self
Set auto-restart behavior
Sourcepub fn with_max_restarts(self, max: u32) -> Self
pub fn with_max_restarts(self, max: u32) -> Self
Set the maximum number of restart attempts.
Sourcepub fn auto_restart(&self) -> bool
pub fn auto_restart(&self) -> bool
Whether auto-restart is enabled.
Sourcepub fn max_restarts(&self) -> u32
pub fn max_restarts(&self) -> u32
Maximum restart attempts.
Sourcepub async fn spawn(
&self,
provider: &Provider,
task: &str,
) -> Result<AgentHandle, SpawnerError>
pub async fn spawn( &self, provider: &Provider, task: &str, ) -> Result<AgentHandle, SpawnerError>
Spawn an agent from a provider configuration
Trait Implementations§
Source§impl Clone for AgentSpawner
impl Clone for AgentSpawner
Source§fn clone(&self) -> AgentSpawner
fn clone(&self) -> AgentSpawner
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 AgentSpawner
impl Debug for AgentSpawner
Auto Trait Implementations§
impl Freeze for AgentSpawner
impl RefUnwindSafe for AgentSpawner
impl Send for AgentSpawner
impl Sync for AgentSpawner
impl Unpin for AgentSpawner
impl UnsafeUnpin for AgentSpawner
impl UnwindSafe for AgentSpawner
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