pub enum PromptCacheStrategy {
Automatic,
Explicit {
breakpoints: Vec<PromptCacheBreakpoint>,
},
}Expand description
Provider-neutral prompt caching strategy.
Variants§
Automatic
Let the provider decide the cacheable prefix automatically.
Explicit
Apply explicit cache breakpoints to selected prefix boundaries.
Fields
§
breakpoints: Vec<PromptCacheBreakpoint>Cache breakpoints in transcript/tool order.
Implementations§
Source§impl PromptCacheStrategy
impl PromptCacheStrategy
Sourcepub fn automatic() -> Self
pub fn automatic() -> Self
Uses the provider’s native automatic cache behavior when available, or any adapter-provided automatic planning fallback.
Sourcepub fn explicit(
breakpoints: impl IntoIterator<Item = PromptCacheBreakpoint>,
) -> Self
pub fn explicit( breakpoints: impl IntoIterator<Item = PromptCacheBreakpoint>, ) -> Self
Uses explicit cache breakpoints.
Trait Implementations§
Source§impl Clone for PromptCacheStrategy
impl Clone for PromptCacheStrategy
Source§fn clone(&self) -> PromptCacheStrategy
fn clone(&self) -> PromptCacheStrategy
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 moreSource§impl Debug for PromptCacheStrategy
impl Debug for PromptCacheStrategy
Source§impl Default for PromptCacheStrategy
impl Default for PromptCacheStrategy
Source§fn default() -> PromptCacheStrategy
fn default() -> PromptCacheStrategy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PromptCacheStrategy
impl<'de> Deserialize<'de> for PromptCacheStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PromptCacheStrategy
impl PartialEq for PromptCacheStrategy
Source§impl Serialize for PromptCacheStrategy
impl Serialize for PromptCacheStrategy
impl Eq for PromptCacheStrategy
impl StructuralPartialEq for PromptCacheStrategy
Auto Trait Implementations§
impl Freeze for PromptCacheStrategy
impl RefUnwindSafe for PromptCacheStrategy
impl Send for PromptCacheStrategy
impl Sync for PromptCacheStrategy
impl Unpin for PromptCacheStrategy
impl UnsafeUnpin for PromptCacheStrategy
impl UnwindSafe for PromptCacheStrategy
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