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§
Sourcefn 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 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).
Sourcefn 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 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.
Sourcefn message_count(&self) -> usize
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".