#[non_exhaustive]pub enum SystemPrompt {
Plain(String),
Blocks(Vec<SystemBlock>),
}Expand description
System prompt passed to the provider. Plain(String) matches the
pre-caching API and is what From<String> / From<&str> produce —
callers that don’t care about prompt caching keep using strings.
Blocks(...) opts in to per-block cache breakpoints (Anthropic emits
the system field as an array; other providers concatenate the
block texts).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Plain(String)
Single string passed to the provider as-is. The default for
callers that don’t care about prompt caching; matches From<&str>
/ From<String>.
Blocks(Vec<SystemBlock>)
Sequence of blocks with optional per-block cache breakpoints.
Anthropic emits this as the wire system array; providers
without per-block caching concatenate the texts.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SystemPrompt
impl Debug for SystemPrompt
Source§impl From<&str> for SystemPrompt
impl From<&str> for SystemPrompt
Auto 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