pub struct AgentSession<'a> { /* private fields */ }Expand description
A session-scoped agent wrapper.
Binds an Agent to a specific session_id, routing all memory
operations through that session for conversation isolation.
Created via Agent::session() or Agent::session_auto().
Implementations§
Source§impl AgentSession<'_>
impl AgentSession<'_>
Sourcepub async fn say(&self, input: &str) -> Result<AgentOutput>
pub async fn say(&self, input: &str) -> Result<AgentOutput>
Send a message within this session.
Equivalent to Agent::run() but uses this session’s ID for memory.
§Errors
Returns an error if the provider fails, tool execution fails, memory operations fail, or max iterations are reached.
Sourcepub fn stream(
&self,
input: &str,
) -> Pin<Box<dyn Stream<Item = Result<StreamEvent>> + Send>>
pub fn stream( &self, input: &str, ) -> Pin<Box<dyn Stream<Item = Result<StreamEvent>> + Send>>
Execute the agent loop with a custom session ID, returning a stream.
Equivalent to Agent::stream() but uses this session’s ID for memory.
Auto Trait Implementations§
impl<'a> Freeze for AgentSession<'a>
impl<'a> !RefUnwindSafe for AgentSession<'a>
impl<'a> Send for AgentSession<'a>
impl<'a> Sync for AgentSession<'a>
impl<'a> Unpin for AgentSession<'a>
impl<'a> UnsafeUnpin for AgentSession<'a>
impl<'a> !UnwindSafe for AgentSession<'a>
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