pub struct DeepAgent { /* private fields */ }
Expand description
Core Deep Agent runtime implementation
This struct contains all the runtime state and behavior for a Deep Agent, including middleware management, tool execution, HITL support, and state persistence.
Implementations§
Source§impl DeepAgent
impl DeepAgent
Sourcepub async fn save_state(&self, thread_id: &ThreadId) -> Result<()>
pub async fn save_state(&self, thread_id: &ThreadId) -> Result<()>
Save the current agent state to the configured checkpointer.
Sourcepub async fn load_state(&self, thread_id: &ThreadId) -> Result<bool>
pub async fn load_state(&self, thread_id: &ThreadId) -> Result<bool>
Load agent state from the configured checkpointer.
Sourcepub async fn delete_thread(&self, thread_id: &ThreadId) -> Result<()>
pub async fn delete_thread(&self, thread_id: &ThreadId) -> Result<()>
Delete saved state for the specified thread.
Sourcepub async fn list_threads(&self) -> Result<Vec<ThreadId>>
pub async fn list_threads(&self) -> Result<Vec<ThreadId>>
List all threads with saved state.
pub fn current_interrupt(&self) -> Option<AgentInterrupt>
pub async fn resume_hitl(&self, action: HitlAction) -> Result<AgentMessage>
Sourcepub async fn handle_message(
&self,
input: impl AsRef<str>,
state: Arc<AgentStateSnapshot>,
) -> Result<AgentMessage>
pub async fn handle_message( &self, input: impl AsRef<str>, state: Arc<AgentStateSnapshot>, ) -> Result<AgentMessage>
Handle message from string input - converts string to AgentMessage internally
Sourcepub async fn handle_message_with_metadata(
&self,
input: impl AsRef<str>,
metadata: Option<MessageMetadata>,
state: Arc<AgentStateSnapshot>,
) -> Result<AgentMessage>
pub async fn handle_message_with_metadata( &self, input: impl AsRef<str>, metadata: Option<MessageMetadata>, state: Arc<AgentStateSnapshot>, ) -> Result<AgentMessage>
Handle message from string input with metadata - converts string to AgentMessage internally
Trait Implementations§
Source§impl AgentHandle for DeepAgent
impl AgentHandle for DeepAgent
fn describe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AgentDescriptor> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_message<'life0, 'async_trait>(
&'life0 self,
input: AgentMessage,
_state: Arc<AgentStateSnapshot>,
) -> Pin<Box<dyn Future<Output = Result<AgentMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for DeepAgent
impl !RefUnwindSafe for DeepAgent
impl Send for DeepAgent
impl Sync for DeepAgent
impl Unpin for DeepAgent
impl !UnwindSafe for DeepAgent
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