pub struct SystemPrompt {
pub cacheable: String,
pub dynamic: String,
}Expand description
Structured system prompt split into cacheable and dynamic sections.
Anthropic automatically caches the longest matching prefix of the system prompt across turns. By placing stable content first (cacheable) and per-turn content after (dynamic), we get ~75% token savings on cache hits.
Fields§
§cacheable: StringStable across turns — gets Anthropic prompt cache hits.
dynamic: StringChanges per turn — always re-sent fresh.
Implementations§
Trait Implementations§
Source§impl Clone for SystemPrompt
impl Clone for SystemPrompt
Source§fn clone(&self) -> SystemPrompt
fn clone(&self) -> SystemPrompt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SystemPrompt
impl RefUnwindSafe for SystemPrompt
impl Send for SystemPrompt
impl Sync for SystemPrompt
impl Unpin for SystemPrompt
impl UnsafeUnpin for SystemPrompt
impl UnwindSafe for SystemPrompt
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