pub trait AgentHandle: Send + Sync {
// Required methods
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;
// Provided methods
fn handle_message_stream<'life0, 'async_trait>(
&'life0 self,
input: AgentMessage,
state: Arc<AgentStateSnapshot>,
) -> Pin<Box<dyn Future<Output = Result<AgentStream>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn current_interrupt<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentInterrupt>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn resume_with_approval<'life0, 'async_trait>(
&'life0 self,
_action: HitlAction,
) -> Pin<Box<dyn Future<Output = Result<AgentMessage>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Abstraction for hosting a fully configured agent (planner + tools + prompts).
Required Methods§
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,
Provided Methods§
Sourcefn handle_message_stream<'life0, 'async_trait>(
&'life0 self,
input: AgentMessage,
state: Arc<AgentStateSnapshot>,
) -> Pin<Box<dyn Future<Output = Result<AgentStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_message_stream<'life0, 'async_trait>(
&'life0 self,
input: AgentMessage,
state: Arc<AgentStateSnapshot>,
) -> Pin<Box<dyn Future<Output = Result<AgentStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a message with streaming response Default implementation falls back to non-streaming handle_message()
Sourcefn current_interrupt<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentInterrupt>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn current_interrupt<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentInterrupt>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current pending interrupt if any Returns None if no interrupts are pending