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: &String) -> Result<(), Error>
pub async fn save_state(&self, thread_id: &String) -> Result<(), Error>
Save the current agent state to the configured checkpointer.
Sourcepub async fn load_state(&self, thread_id: &String) -> Result<bool, Error>
pub async fn load_state(&self, thread_id: &String) -> Result<bool, Error>
Load agent state from the configured checkpointer.
Sourcepub async fn delete_thread(&self, thread_id: &String) -> Result<(), Error>
pub async fn delete_thread(&self, thread_id: &String) -> Result<(), Error>
Delete saved state for the specified thread.
Sourcepub async fn list_threads(&self) -> Result<Vec<String>, Error>
pub async fn list_threads(&self) -> Result<Vec<String>, Error>
List all threads with saved state.
pub fn current_interrupt(&self) -> Option<AgentInterrupt>
pub async fn resume_hitl( &self, action: HitlAction, ) -> Result<AgentMessage, Error>
Sourcepub async fn handle_message(
&self,
input: impl AsRef<str>,
state: Arc<AgentStateSnapshot>,
) -> Result<AgentMessage, Error>
pub async fn handle_message( &self, input: impl AsRef<str>, state: Arc<AgentStateSnapshot>, ) -> Result<AgentMessage, Error>
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, Error>
pub async fn handle_message_with_metadata( &self, input: impl AsRef<str>, metadata: Option<MessageMetadata>, state: Arc<AgentStateSnapshot>, ) -> Result<AgentMessage, Error>
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
'life0: 'async_trait,
DeepAgent: 'async_trait,
fn handle_message<'life0, 'async_trait>(
&'life0 self,
input: AgentMessage,
_state: Arc<AgentStateSnapshot>,
) -> Pin<Box<dyn Future<Output = Result<AgentMessage, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
DeepAgent: '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