Struct DateTimeSection
pub struct DateTimeSection;Expand description
Renders the current local date. Opt-in only: it re-reads the clock on
every render, so including it in a cached system prompt invalidates the
prompt-cache prefix for every session once a day. Long-lived sessions get
the date from the per-turn user-message prefix instead; see
SystemPromptBuilder::with_defaults.
Trait Implementations§
Source§impl PromptSection for DateTimeSection
impl PromptSection for DateTimeSection
fn name(&self) -> &str
fn build(&self, _ctx: &PromptContext<'_>) -> Result<String, Error>
Source§fn build_with_approval_policy(
&self,
ctx: &PromptContext<'_>,
_always_ask: &[String],
) -> Result<String, Error>
fn build_with_approval_policy( &self, ctx: &PromptContext<'_>, _always_ask: &[String], ) -> Result<String, Error>
Build with canonical approval-policy details when the caller has them.
The default preserves compatibility for third-party prompt sections.
Auto Trait Implementations§
impl Freeze for DateTimeSection
impl RefUnwindSafe for DateTimeSection
impl Send for DateTimeSection
impl Sync for DateTimeSection
impl Unpin for DateTimeSection
impl UnsafeUnpin for DateTimeSection
impl UnwindSafe for DateTimeSection
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more