pub trait AgentRuntime: Send + Sync {
// Required methods
fn run<'life0, 'async_trait>(
&'life0 self,
req: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentRunResult, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn run_stream<'life0, 'async_trait>(
&'life0 self,
req: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentEventStream, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RuntimeHealth> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
The primary API for running agent turns.
Required Methods§
Sourcefn run<'life0, 'async_trait>(
&'life0 self,
req: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentRunResult, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
req: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentRunResult, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a single agent turn (blocking until complete).
Sourcefn run_stream<'life0, 'async_trait>(
&'life0 self,
req: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentEventStream, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run_stream<'life0, 'async_trait>(
&'life0 self,
req: AgentRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentEventStream, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute a single agent turn with streaming events.