pub struct AssembledPrompt {
pub segments: Vec<PromptSegment>,
pub transcript: Vec<Message>,
pub ordered_segments: Vec<PromptSegment>,
pub prefix_cache_key: String,
pub rendered_prefix: String,
pub rendered_transcript: String,
pub rendered: String,
pub cache_breakpoints: CacheBreakpoints,
pub system_segment_count: usize,
pub skill_segment_count: usize,
}Expand description
Fully assembled prompt and transcript material ready for provider encoding.
Fields§
§segments: Vec<PromptSegment>§transcript: Vec<Message>§ordered_segments: Vec<PromptSegment>§prefix_cache_key: String§rendered_prefix: String§rendered_transcript: String§rendered: String§cache_breakpoints: CacheBreakpointsSection boundaries that the assembler asks the codec to expose as
cache breakpoints. Codecs that do not support explicit breakpoints
(e.g. OpenAI Responses, which uses prefix-prefix caching) ignore
this; codecs that do (Anthropic) emit cache_control on the last
content block of each marked section.
system_segment_count: usizeIndex into ordered_segments after which the system-prompt
breakpoint applies. None when there are no system segments.
skill_segment_count: usizeNumber of segments at the head of ordered_segments that belong
to the skills section. Always immediately follows the system block.
Implementations§
Source§impl AssembledPrompt
impl AssembledPrompt
Sourcepub fn system_segments(&self) -> &[PromptSegment]
pub fn system_segments(&self) -> &[PromptSegment]
Slice of segments that constitute the system-prompt section.
Sourcepub fn skill_segments(&self) -> &[PromptSegment]
pub fn skill_segments(&self) -> &[PromptSegment]
Slice of segments that constitute the skills section.
Sourcepub fn append_segments(&self) -> &[PromptSegment]
pub fn append_segments(&self) -> &[PromptSegment]
Slice of segments that follow both the system and skills sections — hook-appended context, etc. These never receive a cache breakpoint because they may change turn-to-turn.
Trait Implementations§
Source§impl Clone for AssembledPrompt
impl Clone for AssembledPrompt
Source§fn clone(&self) -> AssembledPrompt
fn clone(&self) -> AssembledPrompt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AssembledPrompt
impl Debug for AssembledPrompt
Source§impl<'de> Deserialize<'de> for AssembledPrompt
impl<'de> Deserialize<'de> for AssembledPrompt
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>,
impl Eq for AssembledPrompt
Source§impl JsonSchema for AssembledPrompt
impl JsonSchema for AssembledPrompt
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for AssembledPrompt
impl PartialEq for AssembledPrompt
Source§fn eq(&self, other: &AssembledPrompt) -> bool
fn eq(&self, other: &AssembledPrompt) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AssembledPrompt
impl Serialize for AssembledPrompt
impl StructuralPartialEq for AssembledPrompt
Auto Trait Implementations§
impl Freeze for AssembledPrompt
impl RefUnwindSafe for AssembledPrompt
impl Send for AssembledPrompt
impl Sync for AssembledPrompt
impl Unpin for AssembledPrompt
impl UnsafeUnpin for AssembledPrompt
impl UnwindSafe for AssembledPrompt
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
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
key and return true if they are equal.