pub struct AgentRuntime { /* private fields */ }Implementations§
Source§impl AgentRuntime
impl AgentRuntime
Sourcepub async fn run_plan_agentic<F>(
&self,
session_id: SessionId,
objective: &str,
generator: Arc<dyn PlanGenerator>,
plan_store: Option<Arc<dyn PlanStore>>,
on_event: F,
) -> Result<RunOutcome, AgentError>
pub async fn run_plan_agentic<F>( &self, session_id: SessionId, objective: &str, generator: Arc<dyn PlanGenerator>, plan_store: Option<Arc<dyn PlanStore>>, on_event: F, ) -> Result<RunOutcome, AgentError>
Run a plan in agentic mode: each step becomes an agent turn.
The agent receives step instructions as user input and decides autonomously
which tools to call. No StepExecutor is needed.
Sourcepub async fn run_plan_deterministic<F>(
&self,
session_id: SessionId,
objective: &str,
generator: Arc<dyn PlanGenerator>,
executor: Arc<dyn StepExecutor>,
policy: Option<Arc<dyn StepContinuePolicy>>,
recovery: Option<Arc<dyn RecoveryStrategy>>,
plan_store: Option<Arc<dyn PlanStore>>,
on_event: F,
) -> Result<RunOutcome, AgentError>
pub async fn run_plan_deterministic<F>( &self, session_id: SessionId, objective: &str, generator: Arc<dyn PlanGenerator>, executor: Arc<dyn StepExecutor>, policy: Option<Arc<dyn StepContinuePolicy>>, recovery: Option<Arc<dyn RecoveryStrategy>>, plan_store: Option<Arc<dyn PlanStore>>, on_event: F, ) -> Result<RunOutcome, AgentError>
Run a plan in deterministic mode: each step is executed directly
through the provided StepExecutor.
Use this when you want the plan to be executed without LLM turn overhead (e.g. predetermined SSH commands).
Source§impl AgentRuntime
impl AgentRuntime
pub async fn create_session(&self) -> SessionId
pub async fn restore_session( &self, session_id: &SessionId, ) -> Option<AgentSession>
pub async fn session(&self, session_id: &SessionId) -> Option<AgentSession>
pub async fn session_or_err( &self, session_id: &SessionId, ) -> Result<AgentSession, AgentError>
pub async fn with_session_mut<F, R>(
&self,
session_id: &SessionId,
f: F,
) -> Result<R, AgentError>where
F: FnOnce(&mut AgentSession) -> R,
pub fn emit_event(&self, event: AgentEvent)
pub fn subscribe_events(&self) -> Receiver<AgentEvent>
pub fn event_bus(&self) -> &EventBus
pub fn session_manager(&self) -> &SessionManager
pub fn llm_engine(&self) -> &LlmEngine
pub fn tool_engine(&self) -> &ToolEngine
pub fn tool_engine_mut(&mut self) -> &mut ToolEngine
pub fn client(&self) -> Arc<dyn LlmClient>
pub fn tools_mut(&mut self) -> &mut ToolRegistry
pub fn config(&self) -> &AgentConfig
pub fn approval_handler(&self) -> Option<&Arc<dyn ApprovalHandler>>
pub async fn cached_approval( &self, session_id: &SessionId, action_key: &str, ) -> bool
pub async fn cache_approval(&self, session_id: &SessionId, action_key: String)
pub async fn save_checkpoint( &self, session_id: &SessionId, checkpoint: CheckpointData, ) -> Result<(), AgentError>
pub async fn load_checkpoint( &self, _session_id: &SessionId, _checkpoint: &CheckpointData, ) -> Result<Option<CheckpointData>, AgentError>
pub async fn resume_from_checkpoint<F>( &self, checkpoint: CheckpointData, on_event: F, ) -> Result<RunOutcome, AgentError>
pub async fn run<F>( &self, session_id: SessionId, on_event: F, ) -> Result<RunOutcome, AgentError>
pub async fn run_turn_with_handler<F>( &self, session_id: SessionId, user_input: &str, on_event: F, ) -> Result<RunOutcome, AgentError>
pub async fn run_turn_stream( &self, session_id: SessionId, user_input: &str, ) -> Result<(Vec<AgentEvent>, RunOutcome), AgentError>
pub async fn add_user_message( &self, session_id: &SessionId, text: impl Into<String>, ) -> Result<(), AgentError>
pub async fn add_system_message( &self, session_id: &SessionId, text: impl Into<String>, ) -> Result<(), AgentError>
pub async fn add_tool_result( &self, session_id: &SessionId, tool_call_id: &str, summary: impl Into<String>, ) -> Result<(), AgentError>
pub async fn get_messages( &self, session_id: &SessionId, ) -> Result<Vec<ChatMessage>, AgentError>
pub async fn validate_session( &self, session_id: &SessionId, ) -> Result<(), AgentError>
pub fn session_store(&self) -> Arc<dyn SessionStore>
Auto Trait Implementations§
impl !RefUnwindSafe for AgentRuntime
impl !UnwindSafe for AgentRuntime
impl Freeze for AgentRuntime
impl Send for AgentRuntime
impl Sync for AgentRuntime
impl Unpin for AgentRuntime
impl UnsafeUnpin for AgentRuntime
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