pub struct DefaultLifecycleManager { /* private fields */ }Expand description
Default lifecycle manager that delegates to existing runner functions.
Implementations§
Source§impl DefaultLifecycleManager
impl DefaultLifecycleManager
pub fn new(llm: Arc<dyn LLMProvider>) -> Self
Trait Implementations§
Source§impl LifecycleManager for DefaultLifecycleManager
impl LifecycleManager for DefaultLifecycleManager
Source§fn initialize_run(
&self,
session: &Session,
config: &AgentLoopConfig,
) -> AgentRuntimeState
fn initialize_run( &self, session: &Session, config: &AgentLoopConfig, ) -> AgentRuntimeState
Initialize runtime state for a new agent run.
Source§fn prepare_round<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'life7, 'life8, 'life9, 'life10, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
task_context: &'life2 mut Option<TaskLoopContext>,
_runtime_state: &'life3 mut AgentRuntimeState,
round: usize,
max_rounds: usize,
config: &'life4 AgentLoopConfig,
cancel_token: &'life5 CancellationToken,
metrics_collector: Option<&'life6 MetricsCollector>,
session_id: &'life7 str,
model_name: &'life8 str,
tools: &'life9 dyn ToolExecutor,
_llm: &'life10 dyn LLMProvider,
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
'life7: 'async_trait,
'life8: 'async_trait,
'life9: 'async_trait,
'life10: 'async_trait,
fn prepare_round<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'life7, 'life8, 'life9, 'life10, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
task_context: &'life2 mut Option<TaskLoopContext>,
_runtime_state: &'life3 mut AgentRuntimeState,
round: usize,
max_rounds: usize,
config: &'life4 AgentLoopConfig,
cancel_token: &'life5 CancellationToken,
metrics_collector: Option<&'life6 MetricsCollector>,
session_id: &'life7 str,
model_name: &'life8 str,
tools: &'life9 dyn ToolExecutor,
_llm: &'life10 dyn LLMProvider,
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
'life7: 'async_trait,
'life8: 'async_trait,
'life9: 'async_trait,
'life10: 'async_trait,
Prepare for a new round. Returns the round ID.
Source§fn handle_round_outcome<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
runtime_state: &'life2 mut AgentRuntimeState,
_task_context: &'life3 mut Option<TaskLoopContext>,
round: usize,
should_break: bool,
) -> Pin<Box<dyn Future<Output = Result<bool, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn handle_round_outcome<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
runtime_state: &'life2 mut AgentRuntimeState,
_task_context: &'life3 mut Option<TaskLoopContext>,
round: usize,
should_break: bool,
) -> Pin<Box<dyn Future<Output = Result<bool, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Handle post-round processing and determine next action.
Returns
true if the agent run should break out of the round loop.Source§fn finalize_run<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
runtime_state: &'life2 mut AgentRuntimeState,
event_tx: &'life3 Sender<AgentEvent>,
session_id: &'life4 str,
config: &'life5 AgentLoopConfig,
metrics_collector: Option<&'life6 MetricsCollector>,
task_context: Option<TaskLoopContext>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
fn finalize_run<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
runtime_state: &'life2 mut AgentRuntimeState,
event_tx: &'life3 Sender<AgentEvent>,
session_id: &'life4 str,
config: &'life5 AgentLoopConfig,
metrics_collector: Option<&'life6 MetricsCollector>,
task_context: Option<TaskLoopContext>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
Finalize the agent run.
Auto Trait Implementations§
impl Freeze for DefaultLifecycleManager
impl !RefUnwindSafe for DefaultLifecycleManager
impl Send for DefaultLifecycleManager
impl Sync for DefaultLifecycleManager
impl Unpin for DefaultLifecycleManager
impl UnsafeUnpin for DefaultLifecycleManager
impl !UnwindSafe for DefaultLifecycleManager
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