pub enum PromptReuse {
Conversation,
SystemPrompt,
Nothing,
}Expand description
Which part of a request the caller will send again, so a provider that keeps a prompt cache marks only that part.
A cache write costs more than fresh input, and it pays back only when the same text is asked again. The caller knows whether it will be; the provider cannot tell. A provider with no prompt cache ignores the hint.
Variants§
Conversation
The conversation grows by a turn and is sent again: mark all of it. This is what a request that says nothing gets.
SystemPrompt
Only the system prompt comes back. Each call adds turns that are never asked again, like one file’s profile under a prompt shared by every file.
Nothing
Nothing comes back: mark nothing.
Trait Implementations§
Source§impl Clone for PromptReuse
impl Clone for PromptReuse
impl Copy for PromptReuse
Source§impl Debug for PromptReuse
impl Debug for PromptReuse
Source§impl Default for PromptReuse
impl Default for PromptReuse
Source§impl<'de> Deserialize<'de> for PromptReuse
impl<'de> Deserialize<'de> for PromptReuse
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
impl Eq for PromptReuse
Source§impl PartialEq for PromptReuse
impl PartialEq for PromptReuse
Source§impl Serialize for PromptReuse
impl Serialize for PromptReuse
impl StructuralPartialEq for PromptReuse
Auto Trait Implementations§
impl Forget for PromptReuse
impl Freeze for PromptReuse
impl Move for PromptReuse
impl RefUnwindSafe for PromptReuse
impl Send for PromptReuse
impl Sync for PromptReuse
impl Unpin for PromptReuse
impl UnsafeUnpin for PromptReuse
impl UnwindSafe for PromptReuse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.