pub struct NoticeGuide { /* private fields */ }Expand description
Notices waiting for the model, delivered before its next call.
Share one Arc<NoticeGuide>: register a clone on the loop with
with_guide, keep the other to push from the host’s event
loop. Delivery is append-only — one user turn at the end of the history.
Implementations§
Source§impl NoticeGuide
impl NoticeGuide
pub fn new() -> Arc<Self> ⓘ
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Anything not yet shown to the model? A run that ends with notices still pending never gave the model the chance to read them.
Sourcepub fn take_pending(&self) -> Vec<String>
pub fn take_pending(&self) -> Vec<String>
Take what is still waiting (e.g. to use as the next run’s input).
Sourcepub fn take_delivered(&self) -> Vec<String>
pub fn take_delivered(&self) -> Vec<String>
Take what the guide has delivered since the last call.
Trait Implementations§
Source§impl Guide for NoticeGuide
impl Guide for NoticeGuide
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 !Freeze for NoticeGuide
impl Forget for NoticeGuide
impl RefUnwindSafe for NoticeGuide
impl Send for NoticeGuide
impl Sync for NoticeGuide
impl Unpin for NoticeGuide
impl UnsafeUnpin for NoticeGuide
impl UnwindSafe for NoticeGuide
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