pub struct AgentSession { /* private fields */ }Expand description
A conversation with one agent.
Implementations§
Source§impl AgentSession
impl AgentSession
pub fn new( config: AgentConfig, model: Arc<dyn ModelBackend>, tools: Arc<ToolRegistry>, policy: SharedPolicy, approver: Arc<dyn Approver>, ) -> Self
pub fn config(&self) -> &AgentConfig
pub fn messages(&self) -> &[Message]
Sourcepub fn restore_messages(&mut self, messages: Vec<Message>)
pub fn restore_messages(&mut self, messages: Vec<Message>)
Restores a saved conversation.
Sourcepub fn use_signed_in_for_next_task(&mut self, profile: Option<String>)
pub fn use_signed_in_for_next_task(&mut self, profile: Option<String>)
Lets research in the next task use the named signed-in profile. Resets to logged out after that task, and is never covered by a standing allow.
Sourcepub async fn run(
&mut self,
input: impl Into<String>,
events: Option<UnboundedSender<AgentEvent>>,
cancel: CancelToken,
) -> Outcome
pub async fn run( &mut self, input: impl Into<String>, events: Option<UnboundedSender<AgentEvent>>, cancel: CancelToken, ) -> Outcome
Runs one task to completion, cancellation or a budget limit.
Auto Trait Implementations§
impl !RefUnwindSafe for AgentSession
impl !UnwindSafe for AgentSession
impl Forget for AgentSession
impl Freeze for AgentSession
impl Move for AgentSession
impl Send for AgentSession
impl Sync for AgentSession
impl Unpin for AgentSession
impl UnsafeUnpin 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