pub struct StageComposition { /* private fields */ }Expand description
An in-progress composition for one stage.
Implementations§
Source§impl StageComposition
impl StageComposition
pub fn new(stage: PromptStage) -> Self
Sourcepub fn system_separator(self, separator: &str) -> Self
pub fn system_separator(self, separator: &str) -> Self
Use the stage’s declared section separator when the dialect concatenates system sections into one slot (the migrated platform literals’ byte identity depends on it). Without this, the dialect’s boundary marker joins.
Sourcepub fn section(self, section: impl PromptSection) -> Self
pub fn section(self, section: impl PromptSection) -> Self
Append a typed base section, rendering it eagerly.
Sourcepub fn section_if(self, include: bool, section: impl PromptSection) -> Self
pub fn section_if(self, include: bool, section: impl PromptSection) -> Self
Typed inclusion predicate: append only when include holds.
Sourcepub fn resolved(self, rendered: RenderedSection, origin: OverrideOrigin) -> Self
pub fn resolved(self, rendered: RenderedSection, origin: OverrideOrigin) -> Self
Append an already-resolved section (the template-resolution path; carries its override origin).
Sourcepub fn compile(
self,
route: &PromptRoute,
dialect: &ModelDialect,
tool_spec_hash: &str,
) -> Result<CompiledPromptProgram>
pub fn compile( self, route: &PromptRoute, dialect: &ModelDialect, tool_spec_hash: &str, ) -> Result<CompiledPromptProgram>
Compile: deterministic budget fit, dialect layout, digests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StageComposition
impl RefUnwindSafe for StageComposition
impl Send for StageComposition
impl Sync for StageComposition
impl Unpin for StageComposition
impl UnsafeUnpin for StageComposition
impl UnwindSafe for StageComposition
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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.