Skip to main content

AdvisorAgent

Trait AdvisorAgent 

Source
pub trait AdvisorAgent:
    Send
    + Sync
    + 'static {
    // Required methods
    fn prompt<'life0, 'async_trait>(
        &'life0 self,
        input: String,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn abort(&self, reason: &str);
    fn reset(&self);
    fn rollback_to<'life0, 'async_trait>(
        &'life0 self,
        count: usize,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn message_count(&self) -> usize;
}
Expand description

Minimal slice of an agent the runtime drives. omp AdvisorAgent. Satisfied by oxi_agent::Agent via a host adapter; tests hand-roll a fake.

Required Methods§

Source

fn prompt<'life0, 'async_trait>( &'life0 self, input: String, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Drive one advisor turn from the given batch text. Err marks the turn failed (triggers the retry/drop-after-3 path).

Source

fn abort(&self, reason: &str)

Abort any in-flight prompt (best-effort). omp abort.

Source

fn reset(&self)

Reset the advisor’s own conversation state. omp reset.

Source

fn rollback_to<'life0, 'async_trait>( &'life0 self, count: usize, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Drop messages appended past count. Called after a failed prompt so a retry doesn’t replay the failed user batch. omp rollbackTo.

Source

fn message_count(&self) -> usize

Current advisor message count (for the rollback snapshot).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§