pub struct PromptBundle {
pub sections: Vec<PromptSection>,
pub stable_hash: String,
}Fields§
§sections: Vec<PromptSection>§stable_hash: StringImplementations§
Source§impl PromptBundle
impl PromptBundle
pub fn new(sections: Vec<PromptSection>) -> Result<Self, String>
pub fn from_instruction_text(text: impl Into<String>) -> Result<Self, String>
Sourcepub fn with_session_memory_context(
&self,
session_memory_context: impl AsRef<str>,
) -> Result<Self, String>
pub fn with_session_memory_context( &self, session_memory_context: impl AsRef<str>, ) -> Result<Self, String>
Freeze persisted Session Memory into the resolved bundle for one run.
A bundle already containing the section is a frozen checkpoint/run bundle, so it must be reused exactly rather than refreshed.
pub fn flatten(&self) -> String
pub fn validate(&self) -> Result<(), String>
pub fn to_value(&self) -> Value
pub fn from_value(value: &Value) -> Result<Self, String>
Trait Implementations§
Source§impl Clone for PromptBundle
impl Clone for PromptBundle
Source§fn clone(&self) -> PromptBundle
fn clone(&self) -> PromptBundle
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 PromptBundle
impl Debug for PromptBundle
Source§impl<'de> Deserialize<'de> for PromptBundle
impl<'de> Deserialize<'de> for PromptBundle
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 PromptBundle
impl PartialEq for PromptBundle
Source§impl Serialize for PromptBundle
impl Serialize for PromptBundle
impl StructuralPartialEq for PromptBundle
Auto Trait Implementations§
impl Freeze for PromptBundle
impl RefUnwindSafe for PromptBundle
impl Send for PromptBundle
impl Sync for PromptBundle
impl Unpin for PromptBundle
impl UnsafeUnpin for PromptBundle
impl UnwindSafe for PromptBundle
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 moreCreates a shared type from an unshared type.