pub struct AgentSession { /* private fields */ }Implementations§
Source§impl AgentSession
impl AgentSession
pub fn subscribe(&mut self, listener: SessionEventHandler) -> SessionListenerId
pub fn unsubscribe(&mut self, listener_id: SessionListenerId) -> bool
Source§impl AgentSession
impl AgentSession
pub fn follow_up(&mut self, prompt: impl Into<String>) -> Result<(), String>
pub fn steer(&mut self, prompt: impl Into<String>) -> Result<(), String>
pub fn steering_handle(&self) -> SessionSteeringHandle
pub fn cancellation_handle(&self) -> SessionCancellationHandle
pub fn cancel(&self) -> bool
pub fn clear_queues(&mut self)
pub fn continue_run( &mut self, prompt: Option<String>, ) -> Result<AgentRun, String>
Source§impl AgentSession
impl AgentSession
Source§impl AgentSession
impl AgentSession
Source§impl AgentSession
impl AgentSession
pub fn state(&self) -> AgentSessionState
Source§impl AgentSession
impl AgentSession
pub fn new( execute_run: Arc<dyn Fn(String) -> Result<AgentRun, String> + Send + Sync>, agent_name: impl Into<String>, definition: AgentDefinition, workspace: impl Into<PathBuf>, ) -> Self
pub fn new_with_session_id( execute_run: Arc<dyn Fn(String) -> Result<AgentRun, String> + Send + Sync>, session_id: impl Into<String>, agent_name: impl Into<String>, definition: AgentDefinition, workspace: impl Into<PathBuf>, ) -> Self
pub fn new_with_context( execute_run: Arc<dyn Fn(AgentSessionRunRequest) -> Result<AgentRun, String> + Send + Sync>, agent_name: impl Into<String>, definition: AgentDefinition, workspace: impl Into<PathBuf>, ) -> Self
pub fn new_with_context_and_session_id( execute_run: Arc<dyn Fn(AgentSessionRunRequest) -> Result<AgentRun, String> + Send + Sync>, session_id: impl Into<String>, agent_name: impl Into<String>, definition: AgentDefinition, workspace: impl Into<PathBuf>, ) -> Self
pub fn session_id(&self) -> &str
pub fn agent_name(&self) -> &str
pub fn definition(&self) -> &AgentDefinition
pub fn workspace(&self) -> &Path
pub fn messages(&self) -> Vec<Message>
pub fn latest_run(&self) -> Option<AgentRun>
pub fn running(&self) -> bool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.