pub struct AgentSession { /* private fields */ }Expand description
Workspace-bound session. All LLM and tool operations happen here.
Implementations§
Source§impl AgentSession
impl AgentSession
Sourcepub async fn send(&self, prompt: &str) -> Result<AgentResult>
pub async fn send(&self, prompt: &str) -> Result<AgentResult>
Send a prompt and wait for the complete response.
Sourcepub async fn send_with_history(
&self,
history: &[Message],
prompt: &str,
) -> Result<AgentResult>
pub async fn send_with_history( &self, history: &[Message], prompt: &str, ) -> Result<AgentResult>
Send a prompt with conversation history.
Sourcepub async fn stream(
&self,
prompt: &str,
) -> Result<(Receiver<AgentEvent>, JoinHandle<()>)>
pub async fn stream( &self, prompt: &str, ) -> Result<(Receiver<AgentEvent>, JoinHandle<()>)>
Send a prompt and stream events back.
Sourcepub async fn bash(&self, command: &str) -> Result<String>
pub async fn bash(&self, command: &str) -> Result<String>
Execute a bash command in the workspace.
Sourcepub async fn glob(&self, pattern: &str) -> Result<Vec<String>>
pub async fn glob(&self, pattern: &str) -> Result<Vec<String>>
Search for files matching a glob pattern.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentSession
impl !RefUnwindSafe for AgentSession
impl Send for AgentSession
impl Sync for AgentSession
impl Unpin for AgentSession
impl UnsafeUnpin for AgentSession
impl !UnwindSafe for AgentSession
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