Struct SystemPromptBuilder
pub struct SystemPromptBuilder { /* private fields */ }Implementations§
Source§impl SystemPromptBuilder
impl SystemPromptBuilder
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Sections every long-lived agent session shares. DateTimeSection is
deliberately absent: it renders Local::now(), so the system block’s
content (and with it every provider prompt-cache entry hashed behind
it) would change once a day per session. The per-turn
[CURRENT DATE & TIME] user-message prefix is the authoritative
clock, so the cached system prefix stays byte-stable. Builders for
paths without that prefix (e.g. the delegate sub-agent prompt) opt in
by adding the section explicitly.
pub fn add_section(self, section: Box<dyn PromptSection>) -> Self
pub fn build(&self, ctx: &PromptContext<'_>) -> Result<String>
Sourcepub fn build_with_approval_policy(
&self,
ctx: &PromptContext<'_>,
always_ask: &[String],
) -> Result<String>
pub fn build_with_approval_policy( &self, ctx: &PromptContext<'_>, always_ask: &[String], ) -> Result<String>
Render built-in policy-aware sections from the same always_ask
values that execution enforces, while leaving custom sections source
compatible through PromptSection’s default method.
Trait Implementations§
Source§impl Default for SystemPromptBuilder
impl Default for SystemPromptBuilder
Source§fn default() -> SystemPromptBuilder
fn default() -> SystemPromptBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SystemPromptBuilder
impl !UnwindSafe for SystemPromptBuilder
impl Freeze for SystemPromptBuilder
impl Send for SystemPromptBuilder
impl Sync for SystemPromptBuilder
impl Unpin for SystemPromptBuilder
impl UnsafeUnpin for SystemPromptBuilder
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