pub trait Guide:
Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> &String;
fn kind(&self) -> Execution;
fn scope(&self) -> &GuideScope;
fn apply<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
world: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
// Provided method
fn apply_before_iter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut Context,
_world: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
}Required Methods§
fn id(&self) -> &String
fn kind(&self) -> Execution
fn scope(&self) -> &GuideScope
Sourcefn apply<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
world: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn apply<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
world: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called ONCE per session, at the start, before the first model call. Use for content that doesn’t change across iterations (profile, skills catalogue, static instructions).
Provided Methods§
Sourcefn apply_before_iter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut Context,
_world: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn apply_before_iter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx: &'life1 mut Context,
_world: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Called BEFORE every model.complete() call within a session
(default: no-op). Override to inject content that should adapt to
the current conversation state — most useful for recall-style guides
that want to re-query an external store based on the last user
message.
Implementations are responsible for cleaning up their previous
injection (typically by tagging their Block::Text with a unique
marker prefix and removing it before pushing a fresh one) — the
framework doesn’t auto-roll-back between iterations.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".