AgentRunAdapter

Trait AgentRunAdapter 

Source
pub trait AgentRunAdapter: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn version(&self) -> &'static str;

    // Provided methods
    fn start<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 AgentRunContext,
    ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn emit<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 AgentRunContext,
        payload: Value,
    ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn checkpoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 AgentRunContext,
        state: Value,
    ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn restore<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: &'life1 AgentRunContext,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Value>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 AgentRunContext,
    ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn error<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 AgentRunContext,
        error: Value,
    ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Contract adapters must implement to surface framework-native runs as FleetForge runs.

Required Methods§

Source

fn name(&self) -> &'static str

Adapter identifier (e.g. langgraph).

Source

fn version(&self) -> &'static str

SemVer-ish adapter version string.

Provided Methods§

Source

fn start<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 AgentRunContext, ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called before the framework starts producing steps for a run.

Source

fn emit<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 AgentRunContext, payload: Value, ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called for intermediate output/state events emitted by the framework.

Source

fn checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 AgentRunContext, state: Value, ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called whenever the framework checkpoints durable state.

Source

fn restore<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: &'life1 AgentRunContext, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called when FleetForge requests a restore. Return Ok(Some(state)) with the previously persisted checkpoint payload if available.

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 AgentRunContext, ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called once the framework considers the run complete.

Source

fn error<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 AgentRunContext, error: Value, ) -> Pin<Box<dyn Future<Output = Result<AgentRunEnvelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called when the framework surfaces a terminal error.

Implementors§