pub struct ExperienceGuide { /* private fields */ }Expand description
Guide that injects recalled experience episodes into the prompt.
Implementations§
Source§impl ExperienceGuide
impl ExperienceGuide
pub fn new(store: Arc<ExperienceStore>) -> Self
Sourcepub fn with_top_k(self, k: usize) -> Self
pub fn with_top_k(self, k: usize) -> Self
How many past episodes to recall per query (default 3). Keep it small — each recalled episode spends prompt tokens.
Trait Implementations§
Source§impl Guide for ExperienceGuide
impl Guide for ExperienceGuide
fn id(&self) -> &GuideId
fn kind(&self) -> Execution
fn scope(&self) -> &GuideScope
Source§fn apply<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
_w: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn apply<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
_w: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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).
Source§fn apply_before_iter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
_w: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn apply_before_iter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
_w: &'life2 World,
) -> Pin<Box<dyn Future<Output = Result<(), GuideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ExperienceGuide
impl !UnwindSafe for ExperienceGuide
impl Forget for ExperienceGuide
impl Freeze for ExperienceGuide
impl Send for ExperienceGuide
impl Sync for ExperienceGuide
impl Unpin for ExperienceGuide
impl UnsafeUnpin for ExperienceGuide
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more