pub struct AgentLoop { /* private fields */ }Expand description
Implementations§
Source§impl AgentLoop
impl AgentLoop
Sourcepub fn new(runtime: Arc<dyn AgentRuntime>, tools: Arc<dyn ToolPort>) -> Self
pub fn new(runtime: Arc<dyn AgentRuntime>, tools: Arc<dyn ToolPort>) -> Self
Create a new agent loop wrapping the given runtime and tool port.
Sourcepub fn with_tape(self, tape: Arc<dyn TapeStorePort>) -> Self
pub fn with_tape(self, tape: Arc<dyn TapeStorePort>) -> Self
Attach a tape store for persistent conversation recording.
Sourcepub fn with_events(self, events: Arc<dyn EventSink>) -> Self
pub fn with_events(self, events: Arc<dyn EventSink>) -> Self
Attach an event sink for observability.
Sourcepub fn with_system_prompt(self, prompt: String) -> Self
pub fn with_system_prompt(self, prompt: String) -> Self
Set a system prompt that overrides the default runtime prompt.
This is typically loaded from a workspace file (e.g. .agent/system-prompt.md)
at the composition root. The content is passed as a pre-loaded string to
keep the runtime free from filesystem dependencies.
Sourcepub async fn handle_input(
&self,
input: &str,
session_id: &str,
) -> Result<AgentLoopOutput, AgentError>
pub async fn handle_input( &self, input: &str, session_id: &str, ) -> Result<AgentLoopOutput, AgentError>
Process a single user input and return the appropriate output.
Slash commands are handled deterministically. Natural language input is forwarded to the LLM pipeline.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentLoop
impl !RefUnwindSafe for AgentLoop
impl Send for AgentLoop
impl Sync for AgentLoop
impl Unpin for AgentLoop
impl UnsafeUnpin for AgentLoop
impl !UnwindSafe for AgentLoop
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